Skip to content

Commit

Permalink
get rid of using tap
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jul 29, 2011
1 parent 836f3d5 commit d788ed5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/will_paginate.rb
Expand Up @@ -36,12 +36,13 @@ def enable_activerecord


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

0 comments on commit d788ed5

Please sign in to comment.