Class: Mongoid::Generators::DeviseGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Devise::Generators::OrmHelpers
Defined in:
lib/generators/mongoid/devise_generator.rb

Instance Method Summary collapse

Methods included from Devise::Generators::OrmHelpers

#model_contents, #model_exists?, #model_path

Instance Method Details

#generate_modelObject



8
9
10
# File 'lib/generators/mongoid/devise_generator.rb', line 8

def generate_model
  invoke "mongoid:model", [name] unless model_exists?
end

#inject_devise_contentObject



12
13
14
# File 'lib/generators/mongoid/devise_generator.rb', line 12

def inject_devise_content
  inject_into_file model_path, model_contents, :after => "include Mongoid::Document\n"
end