Acts As Taggable gem and MySQL duplicate key
Posted on January 12, 2007 - Filed Under RubyOnRails
I was using acts_as_taggable DHH’s plugin. But I have moved to gem based one. After changing my database scheme and making code changes I ran across issue. When I was updating routes with tags ActiveRecord have dumped following error:
ActiveRecord::StatementInvalid (Mysql::Error: Duplicate entry '9' for key 1: INSERT INTO routes_tags (`tag_id`, `id`, `route_id`) VALUES (9, 9, 46)):
I was digging two nights and… long story short – there has to be no primary index on table holding bindings between tags and objects (here: routes_tags table).
Popularity: 3% [?]
Hits for this post: 2961
Similar Posts
- Route tagging
- Migrations headache
- First save, then use :id
- Migrations with advanced data operations
- Including gems with new rubygems
Comments
Leave a Reply


