Using the example in the docs if I say @folder.items and I list the items, everything lists fine. If I delete a ''linking'', I still get the same list. Shouldn''t I get one less item even though the other two db''s haven''t been updated? -- Posted via http://www.ruby-forum.com/.
Josh Susser
2006-Aug-11 15:37 UTC
[Rails] Re: Polymorphic Not Updating after deleting join
ScuzzleButt wrote:> Using the example in the docs if I say > > @folder.items > > and I list the items, everything lists fine. If I delete a ''linking'', I > still get the same list. Shouldn''t I get one less item even though the > other two db''s haven''t been updated?If you delete a join model record, you have to reset or reload the :items" has_many :through association for it to notice the change. You can say @folder.items(true) to return the reloaded list, or @folder.items.reset to just clear the in-memory cache of items. -- Josh Susser http://blog.hasmanythrough.com -- Posted via http://www.ruby-forum.com/.