Class: Rspec::PaperTrail::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#generate_configuration_filesObject



25
26
27
# File 'lib/generators/rspec/paper_trail/install_generator.rb', line 25

def generate_configuration_files
  copy_file 'features/versioning.rb', 'config/features/versioning.rb'
end

#generate_migration_fileObject



17
18
19
20
21
# File 'lib/generators/rspec/paper_trail/install_generator.rb', line 17

def generate_migration_file
  return if options.send(:'skip-migrations')
  migration_template 'migrations/create_versions.rb.erb', 'db/migrate/create_versions.rb'
  migration_template 'migrations/stringify_versions_item_id.rb', 'db/migrate/stringify_versions_item_id.rb' if use_string_ids? && connected? && migrated? && !has_integer_column?
end