Skip to content
Browse files

Fixed the actual problem this time.

  • Loading branch information...
1 parent 89b6ee9 commit bb9c40eafd4768dade916441abcaab585cf4a59e @jyurek jyurek committed Jun 26, 2008
Showing with 6 additions and 6 deletions.
  1. +4 −4 lib/extensions.rb
  2. +2 −2 lib/squirrel.rb
View
8 lib/extensions.rb
@@ -1,12 +1,12 @@
class Hash
- def deep_merge other
- self.dup.deep_merge! other
+ def merge_tree other
+ self.dup.merge_tree! other
end
- def deep_merge! other
+ def merge_tree! other
other.each do |key, value|
if self[key].is_a?(Hash) && value.is_a?(Hash)
- self[key] = self[key].deep_merge(value)
+ self[key] = self[key].merge_tree(value)
else
self[key] = value
end
View
4 lib/squirrel.rb
@@ -321,10 +321,10 @@ def assign_joins join_dependency, ancestries = nil
def to_find_include
@condition_blocks.inject({}) do |inc, cb|
if cb.reflection.nil?
- inc.merge(cb.to_find_include)
+ inc.merge_tree(cb.to_find_include)
else
inc[cb.reflection] ||= {}
- inc[cb.reflection] = inc[cb.reflection].merge(cb.to_find_include)
+ inc[cb.reflection] = inc[cb.reflection].merge_tree(cb.to_find_include)
inc
end
end

0 comments on commit bb9c40e

Please sign in to comment.
Something went wrong with that request. Please try again.