Aryk Grosz
2007-Apr-16 17:01 UTC
Anyway to get << working with has_many through in Rails 1.2?
Is there any way to get the edge rails feature that allows you to do use << to add an object to a relationship, just like in the HABTM. I know Josh Susser talked about about how someone released a fix for it, but it didnt seem to make it into Rails 1.2. Any ideas? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Aryk Grosz
2007-Apr-17 02:38 UTC
Re: Anyway to get << working with has_many through in Rails
I tried extending the relationship, but this method seems a little hackish: has_many :through=>x do def <<(value) JoinTable.create() end end However, Im having a little trouble getting the id for the object since its passing through another relationship. Any ideas. Thanks in advance. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---