public
Rubygem
Description: Most awesome pagination solution for Ruby
Homepage: http://github.com/mislav/will_paginate/wikis
Clone URL: git://github.com/mislav/will_paginate.git
Click here to lend your support to: will_paginate and make a donation at www.pledgie.com !
fix will_paginate for yet another Rails edge change (r9230)
Mislav Marohnić (author)
Sun Apr 06 06:18:39 -0700 2008
commit  b00a298c02df8ab68e18bc107e41ce35533e1af1
tree    40d35050d2d0be7c9205f119b5d819c4fdb39141
parent  1694bb814831a775beb0624a1d2947a90700046d
...
34
35
36
37
38
 
 
 
 
 
 
 
39
40
41
...
34
35
36
 
 
37
38
39
40
41
42
43
44
45
46
0
@@ -34,8 +34,13 @@ module WillPaginate
0
       ActiveRecord::Base.class_eval { include Finder }
0
 
0
       # support pagination on associations
0
-      [ ActiveRecord::Associations::AssociationCollection,
0
-          ActiveRecord::Associations::HasManyThroughAssociation ].each do |klass|
0
+      a = ActiveRecord::Associations
0
+      returning([ a::AssociationCollection ]) { |classes|
0
+        # detect http://dev.rubyonrails.org/changeset/9230
0
+        unless a::HasManyThroughAssociation.superclass == a::HasManyAssociation
0
+          classes << a::HasManyThroughAssociation
0
+        end
0
+      }.each do |klass|
0
         klass.class_eval do
0
           include Finder::ClassMethods
0
           alias_method_chain :method_missing, :paginate

Comments