Forum: Ruby on Rails with_scope :limit is ignored when I do an association

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.
Pat M. (Guest)
on 2007-04-04 05:59
(Received via mailing list)
c is a Company and c has_many :videos.

>> Video.with_scope(:find => { :limit => 5 }) { c.videos }.size
=> 13

it works though when I don't use the association

>> Video.with_scope(:find => { :limit => 5 }) { Video.find :all }.size
=> 5

I found a ticket [1] whose description says it addresses this issue,
but the code definitely looks like it doesn't...anyway does anyone
know of a workaround for this?


This topic is locked and can not be replied to.