Permalink
Browse files

get rid of using `tap`

  • Loading branch information...
1 parent 836f3d5 commit d788ed576280b1efe0ccce145d65cd078a34da75 @mislav committed Jul 29, 2011
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/will_paginate.rb
View
13 lib/will_paginate.rb
@@ -36,12 +36,13 @@ def enable_activerecord
# support pagination on associations
a = ActiveRecord::Associations
- [ a::AssociationCollection ].tap { |classes|
- # detect http://dev.rubyonrails.org/changeset/9230
- unless a::HasManyThroughAssociation.superclass == a::HasManyAssociation
- classes << a::HasManyThroughAssociation
- end
- }.each do |klass|
+ klasses = [ a::AssociationCollection ]
+ # detect http://dev.rubyonrails.org/changeset/9230
+ unless a::HasManyThroughAssociation.superclass == a::HasManyAssociation
+ klasses << a::HasManyThroughAssociation
+ end
+
+ klasses.each do |klass|
klass.send :include, Finder::ClassMethods
klass.class_eval { alias_method_chain :method_missing, :paginate }
end

0 comments on commit d788ed5

Please sign in to comment.