Skip to content

Commit

Permalink
fixed paginate(:from) with Rails versions < 2.1 (references mislav#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Oct 7, 2008
1 parent af80782 commit 1449867
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/will_paginate/finder.rb
Expand Up @@ -184,6 +184,7 @@ def method_missing_with_paginate(method, *args, &block) #:nodoc:
# in the database. It relies on the ActiveRecord +count+ method.
def wp_count(options, args, finder)
excludees = [:count, :order, :limit, :offset, :readonly]
excludees << :from unless ActiveRecord::Calculations::CALCULATIONS_OPTIONS.include?(:from)

# we may be in a model or an association proxy
klass = (@owner and @reflection) ? @reflection.klass : self
Expand Down
2 changes: 1 addition & 1 deletion test/database.yml
Expand Up @@ -17,6 +17,6 @@ mysql:
postgres:
adapter: postgresql
username: mislav
password: mislav
password:
database: will_paginate_unittest
min_messages: warning

0 comments on commit 1449867

Please sign in to comment.