Forum: Ruby on Rails Save only working on New objects

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bob M. (Guest)
on 2009-05-16 08:34
I'm using a habtm self referential (below). When I work with it in the
console, if I do this:

  memberA.friends[0] = memberB

Nothing actually gets saved to the join table. (memberA and memberB are
previously saved objects).

If, however, I do this:

  memberA.friends[0] =     // the new object here is the

the relationship Does get saved to the join table.

Anyone have a clue as to why this is? And how I can get changes to
previously saved objects to save to the sql join table?

This topic is locked and can not be replied to.