Was looking to work on a small addition (to has_many) which will be useful to me and others alike. A few technical details about the addition: Basically wanting to have something like, has_many :subscribers, through: :subscriptions, *source_scope:* :deleted We currently have to do this in our code as, has_many :subscribers, through: :subscriptions, conditions: ''subscriptions.deleted_at IS NOT NULL'' even though Subscription model has already got a :deleted scope. Wouldn''t it be nice to have something like *:source_scope*? Along with this, I''ve found out that if, as per the above example, Subscription has a default scope, it is not picked up while calling subscribers through subscriptions. Sounds like a bug for ''has_many through''? Should I go ahead and implement this? Or is there something similar already fixed/planned? Had a word with Jose Valim about this and he said Jon Leighton & Aaron Patterson are working on this feature for Rails 4? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/mC9PsYd8fxYJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I think I''d rather see scope than source_scope. But that''s really bikeshedding. -- 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 rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
+1 for this. It would be nice if you could also throw in support for :unscoped (to counter the effect of a default_scope on the association), but I suppose even if this doesn''t support that out of the box I could always make an "unfiltered" scope on the association. Sent from my phone On 2012-07-05, at 10:16 AM, Steve Klabnik <steve@steveklabnik.com> wrote:> I think I''d rather see scope than source_scope. > > But that''s really bikeshedding. > > -- > 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 rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. >-- 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 rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.