Can not modify "technique"/"Support" property
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 over 12 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.