Chris@909: class SaltUserPasswords < ActiveRecord::Migration Chris@909: Chris@909: def self.up Chris@909: say_with_time "Salting user passwords, this may take some time..." do Chris@909: User.salt_unsalted_passwords! Chris@909: end Chris@909: end Chris@909: Chris@909: def self.down Chris@909: # Unsalted passwords can not be restored Chris@909: raise ActiveRecord::IrreversibleMigration, "Can't decypher salted passwords. This migration can not be rollback'ed." Chris@909: end Chris@909: end