HI,
I have a question about uniqueness scope.
I have a Scale model with this fields
group_id
name
min_val
max_val
category
for example the first record will have as
- min_val : 0
- max_val : 10
and the next values shouldn't be in that range.
I discovered that I can do this....
validates :min_val, :uniqueness => { :scope => :group_id},
But I want to validate that the new min/max value is not in a already
saved record
Is there a rails way to do that?
Thanks
Javier Q.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.