cjkent-/Nj/XMJRvlBq96Wi6XPAkw@public.gmane.org
2005-May-23 23:16 UTC
single quotes around string primary keys using habtm and MySQL
I''m converting an application to rails using an existing schema and I''ve got a problem with has_and_belongs_to_many. The two related tables have a string primary key and whenever I add a new item with things.other_things.push or push_with_attributes the ID entries in the joining table have single quotes around them. i.e. joining BANK1 to BROKER1 gives me entries with ''BANK1'' and ''BROKER1''. Next time round rails doesn''t think that there''s a relationship between BANK1 and BROKER1. But if I manually update the row to remove the single quotes then everything works fine (at least until I add a new relationship). Does anyone have any ideas? Thanks Chris