Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ActiveRecord::Calculations::CALCULATIONS_OPTIONS is gone from Rails 3

  • Loading branch information...
commit 1814f5a3439333212a4e20cd4fa9db2f394fbf91 1 parent 10e06e6
@dhh authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/will_paginate/finder.rb
View
2  lib/will_paginate/finder.rb
@@ -188,7 +188,7 @@ def method_missing_with_paginate(method, *args) #: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)
+ excludees << :from if defined?(ActiveRecord::Calculations::CALCULATIONS_OPTIONS) && !ActiveRecord::Calculations::CALCULATIONS_OPTIONS.include?(:from)
# we may be in a model or an association proxy
klass = (@owner and @reflection) ? @reflection.klass : self

1 comment on commit 1814f5a

@atajwala

Great timing Dave! Just when i was hitting this problem.

Please sign in to comment.
Something went wrong with that request. Please try again.