class Chive::Generators::DeviseGenerator

Public Instance Methods

manifest() click to toggle source
# File lib/generators/chive/devise_generator.rb, line 16
def manifest
  Rails::Generators.invoke 'devise:install', [], behavior: behavior
  # @todo The User model should be configurable
  Rails::Generators.invoke 'devise', [options[:user]], behavior: behavior
  # @todo Adding a name may or may not be necessary
  migration_template 'add_name_to_devise.rb.tt', "db/migrate/add_name_to_#{options[:user].downcase.pluralize}.rb", {
    migration_file_name: "add_name_to_#{options[:user].downcase.pluralize}"
  }
end

Private Instance Methods

source_paths() click to toggle source
# File lib/generators/chive/devise_generator.rb, line 28
def source_paths
  @source_paths ||= [File.join(Chive::Engine.root, 'templates')]
end
user() click to toggle source
# File lib/generators/chive/devise_generator.rb, line 32
def user
  options[:user].camelize.singularize
end