Mercurial > hg > soundsoftware-site
annotate db/migrate/.svn/text-base/20110223180953_salt_user_passwords.rb.svn-base @ 563:a76abc63257a feature_36
working on the author<->user logic.
| author | luisf <luis.figueira@eecs.qmul.ac.uk> |
|---|---|
| date | Mon, 08 Aug 2011 18:13:30 +0100 |
| parents | 051f544170fe |
| children |
| rev | line source |
|---|---|
| Chris@245 | 1 class SaltUserPasswords < ActiveRecord::Migration |
| Chris@245 | 2 |
| Chris@245 | 3 def self.up |
| Chris@245 | 4 say_with_time "Salting user passwords, this may take some time..." do |
| Chris@245 | 5 User.salt_unsalted_passwords! |
| Chris@245 | 6 end |
| Chris@245 | 7 end |
| Chris@245 | 8 |
| Chris@245 | 9 def self.down |
| Chris@245 | 10 # Unsalted passwords can not be restored |
| Chris@245 | 11 raise ActiveRecord::IrreversibleMigration, "Can't decypher salted passwords. This migration can not be rollback'ed." |
| Chris@245 | 12 end |
| Chris@245 | 13 end |
