Class: CouchrestModel::Generators::ModelGenerator

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

Instance Method Summary collapse

Methods inherited from Base

base_root

Instance Method Details

#create_model_fileObject



8
9
10
# File 'lib/rails/generators/couchrest_model/model/model_generator.rb', line 8

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

#create_module_fileObject



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

def create_module_file
  return if class_path.empty?
  template 'module.rb', File.join('app/models', "#{class_path.join('/')}.rb") if behavior == :invoke
end