Class: Mongoid::Generators::ConfigGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Mongoid::Generators::ConfigGenerator
- Defined in:
- build/mongoid-7.3/lib/rails/generators/mongoid/config/config_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
13 14 15 |
# File 'build/mongoid-7.3/lib/rails/generators/mongoid/config/config_generator.rb', line 13 def self.source_root @_mongoid_source_root ||= File.("../templates", __FILE__) end |
Instance Method Details
#app_name ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'build/mongoid-7.3/lib/rails/generators/mongoid/config/config_generator.rb', line 17 def app_name app_cls = Rails.application.class parent = begin # Rails 6.1+ app_cls.module_parent_name rescue NoMethodError app_cls.parent.to_s end parent.underscore end |
#create_config_file ⇒ Object
28 29 30 |
# File 'build/mongoid-7.3/lib/rails/generators/mongoid/config/config_generator.rb', line 28 def create_config_file template 'mongoid.yml', File.join('config', "mongoid.yml") end |