Wednesday, October 12, 2011

[Rails] update_attribute - effecting multiple attributes

Anybody know why this:

User.find(current_user).update_attribute(:last_subject,
params[:subject_id])

results in this:

AREL (0.6ms) UPDATE "users" SET "last_subject" = 4,
"encrypted_password" =
'f470e6e76203973146c3b07e8b31c976b19cb23a9bf37485ad1911687cdc7a29',
"updated_at" = '2011-10-12 13:43:21.727558' WHERE "users"."id" = 9

For some reason it is updating more than just the :last_subject. Its
also changing the user password and the user can no longer log in again.

Thanks,

DC

--
Posted via http://www.ruby-forum.com/.

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