This project is archived and is in readonly mode.
[Rails 2.3.4 and prior] validates_uniqueness_of fails with non STI inheritance
-
Matt Jones
What's the expected behavior in this instance? Should :login be unique across all records in the students table only, or across all records in users as well?
The former would seem relatively straightforward (change the code that searches for a base class to exclude classes with a different table_name), while the latter would be extremely difficult.
-
Hery
IMHO the expected behavior is a unique login in the students table only.
I know it is a bad design since Mixin should be used instead of inheritance but I just pointed out that this simple code raises a MysqlError.
-
Rohit Arondekar
- State changed from new to stale
- Importance changed from to
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.