Forum: Ruby on Rails Pagination with include + conditions

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
on 2005-11-15 21:43
(Received via mailing list)
This really does look like a bug so I'm going to post it... but has
anyone else come across this? (Sorry for the repeat, but I didn't get
any feedback either way so I'm trying again.)

This code:

@task_pages, @tasks = paginate :task, :conditions=>["tasks.project_id =
?", params['pid']], :include=>[:tasktimes], :per_page => 10

This results in  "NoMethodError: private method `scan' called for..."

Here's a breakpoint trace I did... I placed a breakpoint in

Executing break point at
ociations.rb:962 in `include_eager_conditions?'
irb(Task):001:0> options
=> {:order=>nil, :select=>nil, :conditions=>["tasks.project_id = ?", 9],
:offset=>0, :include=>[:tasktimes], :limit=>10, :joins=>nil}
irb(Task):002:0> options[:conditions]
=> ["tasks.project_id = ?", 9]
irb(Task):003:0> options[:conditions].scan
NoMethodError: private method `scan' called for ["tasks.project_id = ?",

Bug? Or am I just not using this right?

This assumes:

 Task :has_many :tasktimes

Brian H.
Web D.
Learning & Technology Services
Schofield 3-B
University of Wisconsin-Eau Claire
715 836 3585
This topic is locked and can not be replied to.