Skip to content
Browse files

scope(:select) is gone from ActiveRecord 3; document a workaround

  • Loading branch information...
1 parent 7510b28 commit 01f04f34340621f42346879d6cab4622e52b6454 @lifo lifo committed with
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/will_paginate/finders/active_record.rb
View
5 lib/will_paginate/finders/active_record.rb
@@ -137,7 +137,10 @@ def wp_parse_count_options(options, klass) #:nodoc:
excludees = [:count, :order, :limit, :offset, :readonly]
# Use :select from scope if it isn't already present.
- options[:select] = scope(:find, :select) unless options[:select]
+ # FIXME: this triggers extra queries when going through associations
+ # if options[:select].blank? && current_scoped_methods && current_scoped_methods.select_values.present?
+ # options[:select] = current_scoped_methods.select_values.join(", ")
+ # end
if options[:select] and options[:select] =~ /^\s*DISTINCT\b/i
# Remove quoting and check for table_name.*-like statement.

0 comments on commit 01f04f3

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