public
Description: Natural-looking Finder Queries for ActiveRecord
Homepage: http://www.thoughtbot.com/projects/squirrel
Clone URL: git://github.com/thoughtbot/squirrel.git
Fixed the actual problem this time.
jyurek (author)
Thu Jun 26 13:24:49 -0700 2008
commit  bb9c40eafd4768dade916441abcaab585cf4a59e
tree    b363755c3c20ada153fca73c97659a92779a53c5
parent  89b6ee959fd06aecdd46a7576639a3f91be99902
...
1
2
3
 
 
4
5
6
 
7
8
9
 
10
11
12
...
1
 
 
2
3
4
5
 
6
7
8
 
9
10
11
12
0
@@ -1,12 +1,12 @@
0
 class Hash
0
- def deep_merge other
0
- self.dup.deep_merge! other
0
+ def merge_tree other
0
+ self.dup.merge_tree! other
0
   end
0
   
0
- def deep_merge! other
0
+ def merge_tree! other
0
     other.each do |key, value|
0
       if self[key].is_a?(Hash) && value.is_a?(Hash)
0
- self[key] = self[key].deep_merge(value)
0
+ self[key] = self[key].merge_tree(value)
0
       else
0
         self[key] = value
0
       end
...
321
322
323
324
 
325
326
327
 
328
329
330
...
321
322
323
 
324
325
326
 
327
328
329
330
0
@@ -321,10 +321,10 @@ module Squirrel
0
       def to_find_include
0
         @condition_blocks.inject({}) do |inc, cb|
0
           if cb.reflection.nil?
0
- inc.merge(cb.to_find_include)
0
+ inc.merge_tree(cb.to_find_include)
0
           else
0
             inc[cb.reflection] ||= {}
0
- inc[cb.reflection] = inc[cb.reflection].merge(cb.to_find_include)
0
+ inc[cb.reflection] = inc[cb.reflection].merge_tree(cb.to_find_include)
0
             inc
0
           end
0
         end

Comments

    No one has commented yet.