Forum: Ruby on Rails STI with_scope on parent - bug or feature?

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.
B9a732fc30c32098347a0177c75ee27b?d=identicon&s=25 Jeroen Houben (Guest)
on 2006-04-01 09:39
(Received via mailing list)
Hi,

It seems that setting a with_scope on the parent class doesn't do
anything

MyClass.with_scope(:find=>{:conditions=> ["somecol = ?", 'val']}) do
   @ext_pages, @ext_rows = paginate :my_extended_class, {
     :per_page => 13
   }
end
# this doesn't generate WHERE somecol='val'

In order for scope to work you have to call with_scope on the
specialized class you'll later call the find/paginate methods on, like
this:

MyExtendedClass.with_scope()

Should I consider this a feature or a bug?

jeroen
B9a732fc30c32098347a0177c75ee27b?d=identicon&s=25 Jeroen Houben (Guest)
on 2006-04-01 11:07
(Received via mailing list)
Looks like somebody else spotted this too:
http://dev.rubyonrails.org/ticket/4280
This topic is locked and can not be replied to.