123456789_123456789_123456789_123456789_123456789_

Class: Mongoid::Generators::ModelGenerator

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Base, Rails::Generators::NamedBase
Instance Chain:
self, Base, Rails::Generators::NamedBase
Inherits: Mongoid::Generators::Base
Defined in: lib/rails/generators/mongoid/model/model_generator.rb

Overview

Generator class for ::Mongoid model files.

Class Method Summary

Base - Inherited

.source_root

Returns the path to the templates directory.

Instance Method Summary

Instance Method Details

#create_model_file

Creates a model file from a template.

[ GitHub ]

  
# File 'lib/rails/generators/mongoid/model/model_generator.rb', line 22

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