class Geocoder::Generators::Maxmind::GeoliteCityGenerator

Public Class Methods

next_migration_number(dirname) click to toggle source

Define the next_migration_number method (necessary for the migration_template method to work)

# File lib/generators/geocoder/maxmind/geolite_city_generator.rb, line 19
def self.next_migration_number(dirname)
  if ActiveRecord::Base.timestamped_migrations
    sleep 1 # make sure each time we get a different timestamp
    Time.new.utc.strftime("%Y%m%d%H%M%S")
  else
    "%.3d" % (current_migration_number(dirname) + 1)
  end
end

Public Instance Methods

copy_migration_files() click to toggle source
# File lib/generators/geocoder/maxmind/geolite_city_generator.rb, line 13
def copy_migration_files
  migration_template "migration/geolite_city.rb", "db/migrate/geocoder_maxmind_geolite_city.rb"
end