Skip to content

Commit

Permalink
fix will_paginate for yet another Rails edge change (r9230)
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Apr 6, 2008
1 parent 1694bb8 commit b00a298
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/will_paginate.rb
Expand Up @@ -34,8 +34,13 @@ def enable_activerecord
ActiveRecord::Base.class_eval { include Finder }

# support pagination on associations
[ ActiveRecord::Associations::AssociationCollection,
ActiveRecord::Associations::HasManyThroughAssociation ].each do |klass|
a = ActiveRecord::Associations
returning([ a::AssociationCollection ]) { |classes|
# detect http://dev.rubyonrails.org/changeset/9230
unless a::HasManyThroughAssociation.superclass == a::HasManyAssociation
classes << a::HasManyThroughAssociation
end
}.each do |klass|
klass.class_eval do
include Finder::ClassMethods
alias_method_chain :method_missing, :paginate
Expand Down

0 comments on commit b00a298

Please sign in to comment.