Class: Imposter::Generators::GenModelsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Extended by:
TemplatePath
Defined in:
lib/generators/imposter/gen_models/gen_models_generator.rb

Instance Method Summary collapse

Methods included from TemplatePath

source_root

Instance Method Details

#genmodelsObject

Public models automatically executed



16
17
18
19
20
21
22
23
24
# File 'lib/generators/imposter/gen_models/gen_models_generator.rb', line 16

def genmodels
	models_dir = Dir.glob(Rails.root.join('app', 'models').to_s + "/*.rb")
	empty_directory 'test/imposter' # in case it doesn't exist yet
   read_config_file

	models_dir.each do |model_dir|
		genmodel(model_dir)
	end	
end