Class: Migrant::Model

Inherits:
ActiveRecord::Generators::Base
  • Object
show all
Defined in:
lib/generators/model.rb

Instance Method Summary collapse

Instance Method Details

#create_model_fileObject



9
10
11
# File 'lib/generators/model.rb', line 9

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

#protipObject



15
16
17
# File 'lib/generators/model.rb', line 15

def protip
  puts "\nNow, go and edit app/models/#{file_name}.rb and/or generate more models, then run 'rake db:upgrade' to generate your schema."
end