Class: MyGenerators::Generators::ModelGenerator

Inherits:
Mongoid::Generators::Base
  • Object
show all
Includes:
MyScaffoldGenerator
Defined in:
lib/generators/my_generators/model/model_generator.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MyScaffoldGenerator

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MyGenerators::Generators::MyScaffoldGenerator

Class Method Details

.source_rootObject



22
23
24
# File 'lib/generators/my_generators/model/model_generator.rb', line 22

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

Instance Method Details

#create_model_fileObject



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

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