aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/extensions/hash.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/extensions/hash.rb')
-rw-r--r--lib/arel/extensions/hash.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/arel/extensions/hash.rb b/lib/arel/extensions/hash.rb
new file mode 100644
index 0000000000..7472b5aa73
--- /dev/null
+++ b/lib/arel/extensions/hash.rb
@@ -0,0 +1,7 @@
+class Hash
+ def bind(relation)
+ inject({}) do |bound, (key, value)|
+ bound.merge(key.bind(relation) => value.bind(relation))
+ end
+ end
+end \ No newline at end of file