Class: Homeland::Generators::ModelsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Homeland::Generators::ModelsGenerator
- Defined in:
- lib/generators/homeland/models_generator.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#copy_models ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/generators/homeland/models_generator.rb', line 9 def copy_models %w(node reply topic).each do |fname| path = "#{Rails.root}/app/models/homeland/#{fname}.rb" if File.exists?(path) puts "Skipping homeland/#{fname}.rb creation, as file already exists!" else puts "Adding model (homeland/#{fname}.rb)..." template "homeland/#{fname}.rb", path end end end |