Class: Hayfork::Generators::RebuildGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- Hayfork::Generators::RebuildGenerator
- Includes:
- CreateOrReplaceMigrationConcern
- Defined in:
- lib/generators/hayfork/rebuild_generator.rb
Instance Method Summary collapse
Methods included from CreateOrReplaceMigrationConcern
Instance Method Details
#copy_migration ⇒ Object
33 34 35 |
# File 'lib/generators/hayfork/rebuild_generator.rb', line 33 def copy_migration migration_template "migrations/rebuild.rb", "#{db_migrate_path}/rebuild_#{table_name}.rb", migration_version: migration_version end |
#migration_version ⇒ Object
42 43 44 45 |
# File 'lib/generators/hayfork/rebuild_generator.rb', line 42 def migration_version return unless Rails::VERSION::MAJOR >= 5 "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" end |
#table_name ⇒ Object
37 38 39 40 |
# File 'lib/generators/hayfork/rebuild_generator.rb', line 37 def table_name return "haystack" if class_name == "Haystack" super end |