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

.source_rootObject



12
13
14
# File 'lib/rails/generators/mongo_mapper/model/model_generator.rb', line 12

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

Instance Method Details

#create_model_fileObject



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

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