Brad Ediger
2006-Nov-01 15:33 UTC
Why doesn''t HasManyThroughAssociation < AssociationCollection?
Since has_many :through associations behave more like collections after this (http://dev.rubyonrails.org/changeset/4786), is there a technical reason that the HasManyThroughAssociation can''t be an AssociationCollection? I''m hurting for those before_add and after_add callbacks on has_many :through... can anyone give me some pointers on where to start if I wanted to make callbacks available? I''m willing to do the legwork, just wanted to know if there were any caveats I should know about. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rick Olson
2006-Nov-01 17:04 UTC
Re: Why doesn''t HasManyThroughAssociation < AssociationCollection?
On 11/1/06, Brad Ediger <brad@bradediger.com> wrote:> > Since has_many :through associations behave more like collections after this > (http://dev.rubyonrails.org/changeset/4786), is there a > technical reason that the HasManyThroughAssociation can''t be an > AssociationCollection? > > > I''m hurting for those before_add and after_add callbacks on has_many > :through... can anyone give me some pointers on where to start if I wanted > to make callbacks available? I''m willing to do the legwork, just wanted to > know if there were any caveats I should know about. >Add callbacks to the join model. That''s one of the reasons has_many :through was made. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brad Ediger
2006-Nov-01 17:17 UTC
Re: Why doesn''t HasManyThroughAssociation < AssociationCollection?
On Nov 1, 2006, at 11:04 AM, Rick Olson wrote:> > On 11/1/06, Brad Ediger <brad@bradediger.com> wrote: >> >> Since has_many :through associations behave more like collections >> after this >> (http://dev.rubyonrails.org/changeset/4786), is there a >> technical reason that the HasManyThroughAssociation can''t be an >> AssociationCollection? >> >> >> I''m hurting for those before_add and after_add callbacks on has_many >> :through... can anyone give me some pointers on where to start if >> I wanted >> to make callbacks available? I''m willing to do the legwork, just >> wanted to >> know if there were any caveats I should know about. >> > > Add callbacks to the join model. That''s one of the reasons has_many > :through was made.That was my first thought, but the attributes I want to set in my callback differ depending on which association they are being added to. There are multiple associations using the same join model with different conditions. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---