Class: ActiveRecord::Generators::DeviseGenerator
Instance Method Summary
collapse
#model_contents, #model_exists?, #model_path
Instance Method Details
#copy_devise_migration ⇒ Object
16
17
18
|
# File 'lib/generators/active_record/devise_generator.rb', line 16
def copy_devise_migration
migration_template "migration.rb", "db/migrate/devise_create_#{table_name}"
end
|
#generate_model ⇒ Object
12
13
14
|
# File 'lib/generators/active_record/devise_generator.rb', line 12
def generate_model
invoke "active_record:model", [name], :migration => false unless model_exists?
end
|
#inject_devise_content ⇒ Object
20
21
22
23
24
25
|
# File 'lib/generators/active_record/devise_generator.rb', line 20
def inject_devise_content
inject_into_class model_path, class_name, model_contents + <<-CONTENT
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
CONTENT
end
|