Class: MultiTenantSupport::Generators::MigrationGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
ActiveRecord::Generators::Migration
Defined in:
lib/generators/multi_tenant_support/migration_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_migration_fileObject



11
12
13
14
# File 'lib/generators/multi_tenant_support/migration_generator.rb', line 11

def copy_migration_file
  migration_template "migration.rb.tt", "db/migrate/add_domain_and_subdomain_to_#{table_name}.rb"
  puts "\nPlease run this migration:\n\n    rails db:migrate"
end

#migration_versionObject



16
17
18
# File 'lib/generators/multi_tenant_support/migration_generator.rb', line 16

def migration_version
  "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
end