Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Commit

Permalink
Fixed the actual problem this time.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Jun 26, 2008
1 parent 89b6ee9 commit bb9c40e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/extensions.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/squirrel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb9c40e

Please sign in to comment.