aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/core_extensions/hash.rb
diff options
context:
space:
mode:
authorBryan Helmkamp <bryan@brynary.com>2009-09-30 23:23:46 -0400
committerBryan Helmkamp <bryan@brynary.com>2009-09-30 23:23:46 -0400
commit52e8aff146c162986566d3e03852395729d7c24d (patch)
tree1d04e0a73a88b0bf5e091f26ce7ba8c353aeb37d /lib/arel/algebra/core_extensions/hash.rb
parent836a57732c6ddd3842f1bf50e687049a098f7383 (diff)
downloadrails-52e8aff146c162986566d3e03852395729d7c24d.tar.gz
rails-52e8aff146c162986566d3e03852395729d7c24d.tar.bz2
rails-52e8aff146c162986566d3e03852395729d7c24d.zip
Move extensions directories to core_extensions
Diffstat (limited to 'lib/arel/algebra/core_extensions/hash.rb')
-rw-r--r--lib/arel/algebra/core_extensions/hash.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/arel/algebra/core_extensions/hash.rb b/lib/arel/algebra/core_extensions/hash.rb
new file mode 100644
index 0000000000..c64225f685
--- /dev/null
+++ b/lib/arel/algebra/core_extensions/hash.rb
@@ -0,0 +1,11 @@
+module Arel
+ module HashExtensions
+ def bind(relation)
+ inject({}) do |bound, (key, value)|
+ bound.merge(key.bind(relation) => value.bind(relation))
+ end
+ end
+
+ Hash.send(:include, self)
+ end
+end