Displaying 1 result from an estimated 1 matches for "pictures_tags".
Did you mean:
picture_tags
2005 May 23
1
has_and_belongs_to_many dual insert error ?
..."text". The user edits the list, and separates the words using a
comma.
Then, my controller splits everything back, and asks the Picture domain
object to update it''s tags.
The implementation is at the bottom, but the end result is that I get
two rows like this:
INSERT INTO pictures_tags(picture_id, tag_id) VALUES (13, 21);
INSERT INTO pictures_tags(picture_id, tag_id) VALUES (13, 21);
If I add a unique index to pictures_tags, MySQL rejects the second
insert, as it should.
The only way I found to prevent that problem is to save my picture
first, and then to update the tags.
Is...