search for: test_should_fail_duplicate_descr

Displaying 1 result from an estimated 1 matches for "test_should_fail_duplicate_descr".

2007 May 06
1
validates_uniqueness_of (with :scope) doesn't seem to work?
...39;'scope''. Here are the key pieces of information Agycode fields (id, project_id, descr) Here''s the declaration in the Agycode.rb validates_uniqueness_of *:descr*, *:scope* => "project_id" Here''s the test that SHOULDN''T pass but it does *def* test_should_fail_duplicate_descr record1 = *@project*.agycodes.*new*(*:descr* => "description") record2 = record1 assert record1.save, "Save Record" assert_valid(record1) assert record2.save, "Save Record" assert_valid(record2) *end* By the way, do you know how one would write the opposite of &quo...