Class: ActiveRecord::Generators::ModelGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/active_record/model/model_generator.rb

Constant Summary

Constants inherited from Base

Base::DEFAULT_COLLECTION_COLUMN_NAME

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

batch, columns_definition, #quoted_id, simpledb_connection

Class Method Details

.source_rootObject



19
20
21
# File 'lib/generators/active_record/model/model_generator.rb', line 19

def self.source_root
  @source_root ||= File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#create_model_fileObject



13
14
15
# File 'lib/generators/active_record/model/model_generator.rb', line 13

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