Actions
Bug #5
closedCan not modify "technique"/"Support" property
Start date:
2009-01-04
Due date:
% Done:
0%
Estimated time:
Patch Available:
No
Confirmed:
No
Help Needed:
Description
In admin UI, "technique"/"support" property can not be modified : an error appears.
Steps to reproduce :- Log with an admin account
- Go to "Gérer la cimaise / gérer les œuvres"
- Edit one painting (for example painting with name : "Bosquet et arbres morts / Le pavé des roizes")
- Change the technique/support property (select "Papier aquarelle")
- Validate modification
- Error appears :
bq. ActiveRecord::StatementInvalid in Admin/artworksController#update
Mysql::Error: Duplicate entry '8' for key 1: INSERT INTO `artworks_techniques` (`id`, `artwork_id`, `technique_id`) VALUES (8, 22, 8)
Impossible de modifier le support d'une œuvre
Updated by Marc Dequènes almost 16 years ago
- Category changed from Database to Admin UI
Updated by Marc Dequènes over 15 years ago
- Category changed from Admin UI to Database
- Status changed from New to Resolved
This was a database problem indeed. Rails does not handle extra fields well in simple HABTM model, instead of just ignoring it. Thus i removed the join table 'id' field for both supports and materials, and all is well better now. This was closed in commit aaa55822b2685cbeb2456458ce27673ee89083b6.
doc:
http://wiki.rubyonrails.org/howtos/db-relationships/basic?s[]=has&s[]=belongs
http://apidock.com/rails/ActiveRecord/Associations/ClassMethods/has_and_belongs_to_many
Actions