Skip to content

Commit 01e8b81

Browse files
committed
Fixed bug for setting AdminUser to another class name
1 parent 6403eee commit 01e8b81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/generators/active_admin/devise/devise_generator.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ def set_namespace_for_path
3535
end
3636

3737
def add_default_user_to_migration
38-
inject_into_file Dir["db/migrate/*_devise_create_admin_users.rb"].first,
39-
"# Create a default admin user\n #{class_name}.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password')\n\n ",
40-
:before => "add_index :admin_users, :email"
38+
inject_into_file Dir["db/migrate/*_devise_create_#{table_name}.rb"].first,
39+
"# Create a default user\n #{class_name}.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password')\n\n ",
40+
:before => "add_index :#{table_name}, :email"
4141
end
4242

4343
end

0 commit comments

Comments
 (0)