Class: FieldTest::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
ActiveRecord::Generators::Migration
Defined in:
lib/generators/field_test/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_configObject



13
14
15
# File 'lib/generators/field_test/install_generator.rb', line 13

def copy_config
  template "config.yml", "config/field_test.yml"
end

#copy_migrationObject



9
10
11
# File 'lib/generators/field_test/install_generator.rb', line 9

def copy_migration
  migration_template "memberships.rb", "db/migrate/create_field_test_memberships.rb", migration_version: migration_version
end

#migration_versionObject



17
18
19
# File 'lib/generators/field_test/install_generator.rb', line 17

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