Class: MangoChinaCity::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/mango_china_city/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_migratesObject



8
9
10
11
12
13
14
15
# File 'lib/generators/mango_china_city/install_generator.rb', line 8

def generate_migrates
  copy_file "model/province.rb", "#{Rails.root}/app/models/province.rb"
  copy_file "model/city.rb", "#{Rails.root}/app/models/city.rb"
  copy_file "model/district.rb", "#{Rails.root}/app/models/district.rb"
  copy_file "create_provinces.rb", "#{Rails.root}/db/migrate/#{Time.now.strftime("%Y%m%d%H%m")}01_create_provinces.rb"
  copy_file "create_cities.rb", "#{Rails.root}/db/migrate/#{Time.now.strftime("%Y%m%d%H%m")}02_create_cities.rb"
  copy_file "create_districts.rb", "#{Rails.root}/db/migrate/#{Time.now.strftime("%Y%m%d%H%m")}03_create_districts.rb"
end