On 4 nov, 12:31, Craig White <[email protected]> wrote:
> On Nov 4, 2011, at 10:20 AM, JavierQQ wrote:
>
> still not entirely clear but I would think that you need to change...
>
> >>> validates_uniqueness_of :qnumber, :scope => :evaluation_id, :on => :create
>
> to this...
>
> validates_uniqueness_of :qnumber
>

I'm doing that because I can create several evaluations and each
evaluation has an id, that's why I'm scoping by evaluation_id
I found in section 15 of the validation guide, something about
Proc.new
What I want to do with update is that when I hit save it first search
if the number exists(with a where() I guess), if exist it shouldn't
allow me to update
if not, it will let me update the question
Do you suggest to use Proc.new?

Thanks

-- 
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.

Reply via email to