You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to factory_girl
Why update_atributes method doesn't work with model created with
factory-girl?
For example:
@instance = Factory.create(:running_instance)
@instance.update_attributes(:field => value)
field doesn't change his value! update_attributes! doesn't work too.
Where I am wrong?
Nathan Sutton
unread,
Nov 30, 2009, 10:38:47 AM11/30/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to factor...@googlegroups.com
Two ideas:
1) That attribute is protected (attr_accessible or attr_protected). Check in your model for attr_protected or attr_accessible.
2) Updating that attribute makes the model invalid. #update_attributes! would throw an exception in this case though, I think. Try:
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to factory_girl
On Nov 30, 6:38 pm, Nathan Sutton <nathan.sut...@gmail.com> wrote:
> Two ideas:
>
> 1) That attribute is protected (attr_accessible or attr_protected). Check in your model for attr_protected or attr_accessible.
>
This is true. Sorry for that, my fault.
Nathan Sutton
unread,
Nov 30, 2009, 3:11:37 PM11/30/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to factor...@googlegroups.com
No apologies necessary. Using attr_accessible and attr_protected are good things (especially the former).