I have a Rails application setup with Devise , but it is still under development. I also have a Thor task that creates the default admin user.
The problem is that Devise will not allow this administrator user to log in until the account is verified. Is it possible to disable the confirmation module to create specific users, such as Admin?
My Thor task:
class Setup < Thor
desc "create_admin [EMAIL] [PASSWORD]", "Creates the administrative user."
def create_admin(email = "admin@bogus.com", password = "testpassword123")
require File.expand_path('config/environment.rb')
admin = User.create(:email => email, :password => password, :password_confirmation => password)
admin.assign_role :admin
puts "Admin user (#{ email }) created."
end
end
source
share