On 2/24/07, Josh Bassett <[EMAIL PROTECTED]> wrote: > > Is there any way to preserve :joins through a nested with_scope stack? > > Perhaps someone can shed some light on the reasoning behind this > situation.
Danger, danger! with_scope considered harmful. with_scope is not a generic, do-it-all SQL combiner. It was only implemented to allow chaining foreign keys conditions between associations: invoice.lineitems.find(1) == Lineitem.with_scope(:find => { :conditions => ['invoice_id = ?', invoice_id] }) { Lineitem.find(1) } Please combine your conditions and joins explicitly if possible. jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---