Class: SeedUpgrade::ReviseModelGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
GeneratorHelpers, VkillGemsMethods::Rails::Generators::Base
Defined in:
lib/generators/seed_upgrade/revise_model/revise_model_generator.rb

Instance Method Summary collapse

Methods included from GeneratorHelpers

#generate_seed_file_data

Instance Method Details

#create_models_seed_fileObject



9
10
11
12
13
14
15
# File 'lib/generators/seed_upgrade/revise_model/revise_model_generator.rb', line 9

def create_models_seed_file

  ::ActiveRecord::Base.models do |model, columns|
    create_file "db/seeds/#{ model.name.underscore }.rb", generate_seed_file_data(model.name.underscore)
  end

end