Self-referential HABTM SQL mal-formed when updating record

Sazima
2008-01-23T21:02:49Z

Guys,

Anyone ever had this kind of problem with ActiveScaffold?

Cheers, Sazima

------------------------------------------------------------------------------------------------

What steps will reproduce the problem?
1. Create self-referential HABTM application (like the common "user
has friends" example)

2. Try to add more than 1 friend to a given user using ActiveScaffold.

What is the expected output? What do you see instead?
2+ friends related to the user. Instead I get a MySQL error:

ActiveRecord::StatementInvalid (Mysql::Error: Duplicate entry
''4'' for
key
1: INSERT INTO friends (`updated_at`, `id`, `user_id`, `created_at`,
`friend_id`) VALUES (''2008-01-22 20:27:49'', 4, 2,
''2008-01-22
20:26:31'', 4))

What version (or revision) of the product are you using?
1.1.1 + Rails 2.0.2 (InstantRails 2 installation)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---