i think you want ActiveRecord::Base#save_with_attributes
On 9/6/05, Andrew <bubi-y4e253sMjr3QT0dZR+AlfA@public.gmane.org>
wrote:> I have 3 table:
> Users, Groups and Groups_Users and i use push_with_attributes to insert a
field
> called ''state'' in the Groups_Users table. The problem is
that now i could not
> modify this value.
> I have try with this code but nothing:
> --------------------------
> sql = ''SELECT j.* FROM events_users j, events t WHERE t.id =
j.event_id AND
> j.user_id = ? AND j.event_id = ?''
> accept = EventsUser.find_by_sql([sql , @session[:user][:id],
@params[:id]]).first
> accept.state="A"
> accept.save
> ---------------------------
>
> How can i solve this problem?
> Ther''is the pssibility to create an update query in rails?
>
> Thanks all!
> Andrea.
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Zachery Hostens <zacheryph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>