I have a "has_and_belongs_to_many" relationship between two tables,
meaning I have a join table that contains the two ids of each table.
For simplicity let''s call them "foo" and "bar". I
want to delete a bar
from a foo but not actually delete the bar itself.
foo = Foo.find(1)
bar = Bar.find(1)
foo.bars << bar
foo.bars.delete(bar) # actually deletes the bar record which I don''t
want
so what should I do to remove the association, but retain the bar
record?
thanks
--
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
-~----------~----~----~----~------~----~------~--~---