Class: Mongoid::Generators::ConfigGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/rails/generators/mongoid/config/config_generator.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) source_root



11
12
13
# File 'lib/rails/generators/mongoid/config/config_generator.rb', line 11

def self.source_root
  @_mongoid_source_root ||= File.expand_path("../templates", __FILE__)
end

Instance Method Details

- (Object) app_name



15
16
17
# File 'lib/rails/generators/mongoid/config/config_generator.rb', line 15

def app_name
  Rails::Application.subclasses.first.parent.to_s.underscore
end

- (Object) create_config_file



19
20
21
# File 'lib/rails/generators/mongoid/config/config_generator.rb', line 19

def create_config_file
  template 'mongoid.yml', File.join('config', "mongoid.yml")
end