Sha256: 541911189c426b64dcbcf3c52285cc4472877220422084fdf68ff9353a6acd3e
Contents?: true
Size: 1017 Bytes
Versions: 6
Compression:
Stored size: 1017 Bytes
Contents
module EffectiveRegions module Generators class InstallGenerator < Rails::Generators::Base include Rails::Generators::Migration desc 'Creates an EffectiveRegions initializer in your application.' source_root File.expand_path('../../templates', __FILE__) def self.next_migration_number(dirname) if not ActiveRecord::Base.timestamped_migrations Time.new.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end def copy_initializer template ('../' * 3) + 'config/effective_regions.rb', 'config/initializers/effective_regions.rb' end def create_migration_file @regions_table_name = ':' + EffectiveRegions.regions_table_name.to_s @ck_assets_table_name = : + EffectiveRegions.ck_assets_table_name.to_s migration_template ('../' * 3) + 'db/migrate/01_create_effective_regions.rb.erb', 'db/migrate/create_effective_regions.rb' end end end end
Version data entries
6 entries across 6 versions & 1 rubygems