Learn by Doing wrote:
This question regards the Composite Primary Keys gem
Once I use set_primary_keys, should I also use
validates_uniqueness_of to ensure that the composite primary key is
You could, but remember that the DB will catch that in any case.
attr_readonly to ensure that the attributes in the primary key would
not be overwritten?
Depends. If you’re using a composite key, presumably it’s built up from
domain data, so in many cases, you wouldn’t want to make it read-only.
What is your data like that you think you need this?