public
Description: Natural-looking Finder Queries for ActiveRecord
Homepage: http://www.thoughtbot.com/projects/squirrel
Clone URL: git://github.com/thoughtbot/squirrel.git
Added a safeguard so find doesn't get aliased twice.

git-svn-id: https://svn.thoughtbot.com/plugins/squirrel/trunk@412 
7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
jyurek (author)
Wed Mar 26 13:39:58 -0700 2008
commit  1d036bd1e05dea1dce06d1bb52a013a0f01a3a4b
tree    56c0b6911a36841be5227cbfff52103a0a0c2e8f
parent  775d386ff34c79f89b4fb9b0317283dcf5dc1186
...
18
19
20
21
22
23
 
 
 
 
 
24
25
26
...
18
19
20
 
 
 
21
22
23
24
25
26
27
28
0
@@ -18,9 +18,11 @@ module Squirrel
0
     end
0
 
0
     def self.included base
0
- base.class_eval do
0
- alias_method :find_without_squirrel, :find
0
- alias_method :find, :find_with_squirrel
0
+ unless base.instance_methods.include? 'find_without_squirrel'
0
+ base.class_eval do
0
+ alias_method :find_without_squirrel, :find
0
+ alias_method :find, :find_with_squirrel
0
+ end
0
       end
0
     end
0
   end

Comments

    No one has commented yet.