Module: MigrationTools::MigrationExtension
- Defined in:
- lib/migration_tools/migration_extension.rb
Instance Attribute Summary collapse
-
#migration_group ⇒ Object
Returns the value of attribute migration_group.
Instance Method Summary collapse
Instance Attribute Details
#migration_group ⇒ Object
Returns the value of attribute migration_group.
4 5 6 |
# File 'lib/migration_tools/migration_extension.rb', line 4 def migration_group @migration_group end |
Instance Method Details
#group(arg = nil) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/migration_tools/migration_extension.rb', line 6 def group(arg = nil) unless MigrationTools::MIGRATION_GROUPS.member?(arg.to_s) raise "Invalid group \"#{arg.to_s}\" - valid groups are #{MigrationTools::MIGRATION_GROUPS.inspect}" end self.migration_group = arg.to_s end |
#migrate_with_forced_groups(direction) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/migration_tools/migration_extension.rb', line 14 def migrate_with_forced_groups(direction) if MigrationTools.forced? && migration_group.blank? raise "Cowardly refusing to run migration without a group. Read https://github.com/zendesk/migration_tools/blob/master/README.md" end migrate_without_forced_groups(direction) end |