Skip to content

Commit

Permalink
Merge pull request #184 from redgetan/lazyload
Browse files Browse the repository at this point in the history
Extend will_paginate only when ActiveRecord::Base is loaded
  • Loading branch information
parndt committed Mar 27, 2012
2 parents 233cac4 + 64c9199 commit 8cd10f4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions config/initializers/will_paginate.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
if defined?(WillPaginate)
module WillPaginate
module ActiveRecord
module RelationMethods
alias_method :per, :per_page
alias_method :num_pages, :total_pages
ActiveSupport.on_load :active_record do
module WillPaginate
module ActiveRecord
module RelationMethods
alias_method :per, :per_page
alias_method :num_pages, :total_pages
end
end
end
end
Expand Down

0 comments on commit 8cd10f4

Please sign in to comment.