Class: Mongoid::Generators::Base

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/rails/generators/mongoid_generator.rb

Overview

Base generator class for adding Mongoid to Rails applications.

Direct Known Subclasses

ModelGenerator

Class Method Summary collapse

Class Method Details

.source_rootString

Returns the path to the templates directory.

Returns:

  • (String)

    The path.



16
17
18
19
# File 'lib/rails/generators/mongoid_generator.rb', line 16

def self.source_root
  @_mongoid_source_root ||=
    File.expand_path("../#{base_name}/#{generator_name}/templates", __FILE__)
end