diff options
Diffstat (limited to 'lib/arel/algebra/extensions/hash.rb')
-rw-r--r-- | lib/arel/algebra/extensions/hash.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/arel/algebra/extensions/hash.rb b/lib/arel/algebra/extensions/hash.rb index 82cd5e11d3..05c15e7ebe 100644 --- a/lib/arel/algebra/extensions/hash.rb +++ b/lib/arel/algebra/extensions/hash.rb @@ -1,7 +1,11 @@ -class Hash - def bind(relation) - inject({}) do |bound, (key, value)| - bound.merge(key.bind(relation) => value.bind(relation)) +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 |