I just didn't follow that code... because I wasn't sure enough how would it
handle the data,
by that I mean... how does rails know wich one is the data that is going to
be validated and the data used for the validation,
I was searching and I guess the that a solution can be made with Proc.new
validates :minimun_value,
:uniqueness => {:scope=> [:group_id]},
:exclusion => { :in => Proc.new{|r|
[(r.minimun_value)..(r.maximun_value)]}}
(the model Scale belongs_to Group, and Group has_many scales)
but nothing happens. I choose Proc.new because (as far as I understood) it
let me go through the entire table, is that correct?
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.