Saturday, November 14, 2009

[Rails] Re: authlogic fails on existing accounts when crypted_password is blank

On Nov 13, 6:01 pm, "Todd A. Jacobs" <tjacobs-sndr-
b4f...@codegnome.org> wrote:

> How can I get authlogic to either use the cleartext passwords, or to
> bulk-populate the crypted_password and password_salt fields for existing
> accounts?

OTTOMH:

User.find(:all).each do |user|
user.password = user.cleartextpassword
user.password_confirmation = user.cleartextpassword
user.save
end

(the password_confirmation might not be necessary)

Remember authlogic adds its own password method, there might be
unpleasantness if you have a column called password too.
--~--~---------~--~----~------------~-------~--~----~
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