For those who are interested, I''ve just figured it out. My primary key
in my
join tabel isn''t called id any more and my model for the join table is
as
follows:
class Dispatch < ActiveRecord::Base
belongs_to :group
belongs_to :user
def self.table_name() "groups_users" end
set_primary_key(''dispatchid'')
end
On 30/09/05, Adam Groves
<adam.groves-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> I get the following error when using update_attributes on the hash from a
> form.
>
> #23000Duplicate entry ''1'' for key 1: INSERT INTO
groups_users (`group_id`, `id`, `user_id`) VALUES (''6'', 1,
''1'')
>
> I''ve found a ticket for this at
http://dev.rubyonrails.com/ticket/1031 but
> don''t really want to add the patches as (if I ever finish this
project), I
> won''t be hosting my app. My groups_users join table also has a
model with
> which I''d like users to be able to call their group relationships
and edit
> the additional attributes present in the groups_users table. Any ideas?
>
> Regards
> Adam Groves
>
--
To find out what we''re up to visit http://prenzlberg.blogspot.com
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails