
[PATCH] Add composite scope to validates_uniqueness
Reported by Jeffrey Gelens | December 13th, 2007 @ 02:15 AM
In order to let unique composite indexes (the patch I created earlier) to do their job it should be checked using a validation.
Example:
add_index [:server_id, :name, :collected], :unique => true
validates_uniqueness_of :server_id, :event => :save, :scope => [:name, :collected]
Of course later this validation should be generated automatically when creating the index.
Comments and changes to this ticket
-
Bjørn Arild Mæland December 14th, 2007 @ 02:22 AM
- Milestone cleared.
- State changed from new to resolved
Thanks! Applied in r604
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »