On 30 Jul 2012 18:14, "jsnark" <s...@monmouth.com> wrote:
>
> I have a database table that contains encrypted passwords along with other information relating to users. When I do an update_attributes operation on a row in the table with a hash that does not contain a password, the password gets reset to the empty string. How can I stop this?
Remove the password key/value pair from the params hash before the update-attributes call if the password value is blank.
On 30 Jul 2012 18:14, "jsnark" wrote:
>
> I have a database table that contains encrypted passwords along with other information relating to users. When I do an update_attributes operation on a row in the table with a hash that does not contain a password, the password gets reset to the empty string. How can I stop this?Remove the password key/value pair from the params hash before the update-attributes call if the password value is blank.
On 30 July 2012 20:23, jsnark wrote:
> The hash does not contain a password key/value pair. In spite of this, the
> password is set to the empty string.
What filters run in the model? What observers are operating?
It would be worth setting a breakpoint at your update_attribute line
and following through from there to see what happens to your password
attribute.
before_save do_something, :if => Proc.new {|model| model.some_boolean_attr_or_method }--
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 rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/RIfvsT32vIsJ.