Conrad Taylor wrote: > On Fri, Jul 24, 2009 at 5:36 AM, Joao Silva < > [email protected]> wrote: > >> >> > named_scope :ignored, :conditions => { :ignored => true } >> >> >> > The above name_scope here redefines the previous definition. >> >> ok, so how i can fix it? imho this should work ,but not :-( > > > It really depends on what you're trying to do. If you can post > the SQL that's being generated, we can better assist you. > > -Conrad
Ok, here is my code: @messages = @brands.messages.ignored.paginate :per_page => 25, :page => params[:page] And sql generated: Message Load (4.0ms) SELECT * FROM `messages` WHERE (`messages`.brand_id = 2) AND (((`messages`.`ignored` = 0)) AND ((`messages`.`ignored` = 0) AND (`messages`.brand_id = 2))) ORDER BY posted_on DESC LIMIT 0, 25 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

