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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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?

Pat

[1] http://dev.rubyonrails.org/ticket/5208
This topic is locked and can not be replied to.