Tuesday, January 18, 2011

[Rails] Re: Factory Girl and attr_accessor with validation

Thanks, but I have tried that - I get the same result.
Validation seems to get called on build as well as create.

On Jan 17, 9:20 pm, Luke Cowell <lcow...@gmail.com> wrote:
> On 2011-01-17, at 9:51 AM, adam wrote:
>
>
>
> > It falls over on validation - Validation failed: Tc check must be
> > accepted (ActiveRecord::RecordInvalid)
>
> > I've also tried setting it when called create like
> > Factory.create(:valid_user, :tc_check => true) which has the same
> > result.
>
> What happens if you do this:
>
> u = Factory.build(:valid_user)
> u.tc_check = true
> u.save!
>
> Luke

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


Real Estate