Class: MongoMapper::Generators::ModelGenerator

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

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) source_root



16
17
18
# File 'lib/rails/generators/mongo_mapper/model/model_generator.rb', line 16

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

Instance Method Details

- (Object) create_model_file



20
21
22
# File 'lib/rails/generators/mongo_mapper/model/model_generator.rb', line 20

def create_model_file
  template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
end