Hi, I'm in the process of learning rails. I've found Devise to be great with getting authentication up and running quickly and seamlessly but I do have one question.
How do I change the modules after the first run of the Devise generator (e.g. rails g devise User)? This defaults with the following migration:
def self.up
create_table(:users) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable
# t.confirmable
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.token_authenticatable
t.timestamps
end
add_index :users, :email, :unique => true
add_index :users, :reset_password_token, :unique => true
# add_index :users, :confirmation_token, :unique => true
# add_index :users, :unlock_token, :unique => true
end
If I've run this migration, how do I add/remove some of those modules at a later stage? E.g. Maybe I want to add lockable to an existing User model. I understand how to make the changes in the model and devise.rb
but I'm not sure what to do with the migrations.
Apologies if the answer is here already, I've trawled for a couple of hours here and in google and couldn't find anything. Maybe I'm searching for the wrong thing.
Thanks in advance!
Jason
ps. I'm using
rails 3.0.0
devise 1.1.3