Class: Ahoy::Generators::Clicks::ActiverecordGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
ActiveRecord::Generators::Migration
Defined in:
lib/generators/ahoy/clicks/activerecord_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_migrationObject



10
11
12
# File 'lib/generators/ahoy/clicks/activerecord_generator.rb', line 10

def copy_migration
  migration_template "migration.rb", "db/migrate/create_ahoy_clicks.rb", migration_version: migration_version
end

#migration_versionObject



14
15
16
# File 'lib/generators/ahoy/clicks/activerecord_generator.rb', line 14

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