steven_noble
2009-Jul-13 08:19 UTC
Data-only migrations when User model does not store plain text passwords
Hi all, How do you create a data-only migration for my User model that adds a password salt and encrypted password to the Users table? Also, my model validates the equivalence of :password and :password_confirmation, neither of which are columns in the Users table. I need my data-only migration to either bypasses the validation or pass it. How do I do this? Thanks! Steven.
steven_noble
2009-Jul-13 11:13 UTC
Re: Data-only migrations when User model does not store plain text passwords
In case anyone has a similar problem, a workaround is to populate your Users table using seed_fu: http://github.com/mbleigh/seed-fu/tree/master s. On Jul 13, 6:19 pm, steven_noble <ste...-IeilculjuCusTnJN9+BGXg@public.gmane.org> wrote:> Hi all, > > How do you create a data-only migration for my User model that adds a > password salt and encrypted password to the Users table? > > Also, my model validates the equivalence of :password > and :password_confirmation, neither of which are columns in the Users > table. I need my data-only migration to either bypasses the validation > or pass it. How do I do this? > > Thanks! > > Steven.
steven_noble
2009-Jul-13 11:14 UTC
Re: Data-only migrations when User model does not store plain text passwords
In case anyone else has this a problem, a work-around is to popular the Users table using seed_fu. Then you can just pass it the :password and :password_confirmation, and your app takes care of generating the salted versions etc. s. On Jul 13, 6:19 pm, steven_noble <ste...-IeilculjuCusTnJN9+BGXg@public.gmane.org> wrote:> Hi all, > > How do you create a data-only migration for my User model that adds a > password salt and encrypted password to the Users table? > > Also, my model validates the equivalence of :password > and :password_confirmation, neither of which are columns in the Users > table. I need my data-only migration to either bypasses the validation > or pass it. How do I do this? > > Thanks! > > Steven.