Derive "diesel::Identifiable" if struct has a primary-key
This PR adds derive diesel::Identifiable to all Read-structs which have a primary key.
fixes #133
Note: personally i thought the Identifiable is only necessary for Associations or if you want to use the struct directly in a update (see doc quote)
This must be implemented to use associations. Additionally, implementing this trait allows you to pass your struct to
update(update(&your_struct)is equivalent toupdate(YourStruct::table().find(&your_struct.primary_key())
@longsleep does this properly fix you case? also could you explain why it would be necessary aside from Associations or is the second "helper"(the update(&struct)) the reason?
@longsleep does this properly fix you case? also could you explain why it would be necessary aside from
Associationsor is the second "helper"(theupdate(&struct)) the reason?
Users of the generated structs might need the Identifiable trait in their own code (like to get access to the id function or for other purposes).