I have a master record called 'project' and a child record called 'agycode'. Obviously, agycode has a project_id FK. I wish to make the "descr" field unique ONLY within the 'project_id' 'scope'. Here are the key pieces of information
Agycode fields (id, project_id, descr)
Here’s the declaration in the Agycode.rb
:scope => “project_id”
Here’s the test that SHOULDN’T pass but it does
new**(:descr => “description”
record2 = record1
By the way, do you know how one would write the opposite of “assert_valid”?