Re: [Rails] Simple model metod soes not working
On Sun, Feb 12, 2012 at 9:43 AM, Marcin S <msporysz06@gmail.com> wrote:
> Hey i have this testing action in my controller
>
> def update_paids
> o = Order.find(6)
> o.paid=false
> o.save!
> end
>
> and i can't get it to work, changes are not pushed to database! ive
> also tried to do this by update_attributes method, no effect as well.
>
> I have attr_accessor :paid in Order model.
> When i look on server log i only see query that loads model (i
> confirmed it finds correct object)
>
> Order Load (62.8ms) SELECT "orders".* FROM "orders" WHERE
> "orders"."id" = ? LIMIT 1 [["id", 6]]
>
> there is no update or any other query after that.
> What's wrong?
>
Is that action routed?
--
Leonardo Mateo.
There's no place like ~
--
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