Class: Lookylu::Generators::StateDataGenerator

Inherits:
BaseGenerator
  • Object
show all
Defined in:
lib/generators/lookylu/state_data_generator.rb

Instance Method Summary collapse

Methods inherited from BaseGenerator

#file_name, #model_name, #plural_model_name, #plural_name

Instance Method Details

#append_seedsObject



9
10
11
12
13
14
15
16
17
# File 'lib/generators/lookylu/state_data_generator.rb', line 9

def append_seeds

  the_file = 'db/seeds.rb'
  to_append = "\nLookyLu::States.insert_data('#{options.country_name}', '#{object_name}')\n"

  FileUtils.touch the_file
  append_file(the_file, to_append)

end