diff options
Diffstat (limited to 'lib/active_relation/extensions')
-rw-r--r-- | lib/active_relation/extensions/hash.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/active_relation/extensions/hash.rb b/lib/active_relation/extensions/hash.rb index a33ace5738..7472b5aa73 100644 --- a/lib/active_relation/extensions/hash.rb +++ b/lib/active_relation/extensions/hash.rb @@ -1,11 +1,7 @@ class Hash def bind(relation) - descend { |x| x.bind(relation) } - end - - def descend(&block) - inject({}) do |descendent, (key, value)| - descendent.merge(yield(key) => yield(value)) + inject({}) do |bound, (key, value)| + bound.merge(key.bind(relation) => value.bind(relation)) end end end
\ No newline at end of file |