Class: MongoMapper::Generators::DeviseGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- MongoMapper::Generators::DeviseGenerator
- Includes:
- Devise::Generators::OrmHelpers
- Defined in:
- lib/generators/mongo_mapper/devise_generator.rb
Instance Method Summary collapse
Instance Method Details
#generate_model ⇒ Object
8 9 10 |
# File 'lib/generators/mongo_mapper/devise_generator.rb', line 8 def generate_model invoke "mongo_mapper:model", [name] unless model_exists? end |
#inject_devise_content ⇒ Object
12 13 14 |
# File 'lib/generators/mongo_mapper/devise_generator.rb', line 12 def inject_devise_content inject_into_file model_path, model_contents, :after => "include MongoMapper::Document\n" end |
#replace_default_devise_orm ⇒ Object
16 17 18 |
# File 'lib/generators/mongo_mapper/devise_generator.rb', line 16 def replace_default_devise_orm gsub_file Rails.root.join("config/initializers/devise.rb"), 'orm/active_record', 'orm/mongo_mapper' end |