[Rails] Re: weird stuff: validate_uniqueness_of with :scope does not work
On Sep 7, 11:55 am, Swartz <netv...@gmail.com> wrote:
> However, as soon as I create a member through a controller-backed
> form, the uniqueness validation gets tripped up. I get validation
> error from my validates_uniqueness_of as "Folder already exists for
> this member". Which shouldn't happen.
>
> For some strange reason :scope gets ignored and thus uniqueness check
> isn't properly scoped by member_id...
>
> The weird part is that it all works in script/console, but not via web
> forms.
>
Is there some odd interaction because you're creating these folders
from a before_save (ie the member's id has not yet been set)?
Fred
> Any suggestions???
>
> Thanks in advance!
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home