Class: SlashMigrate::MigrationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SlashMigrate::MigrationsController
- Defined in:
- app/controllers/slash_migrate/migrations_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
16 17 18 19 20 |
# File 'app/controllers/slash_migrate/migrations_controller.rb', line 16 def destroy result = runner.delete(params[:version]) flash[result.success? ? :notice : :alert] = result.output redirect_to migrations_path end |
#index ⇒ Object
3 4 5 6 |
# File 'app/controllers/slash_migrate/migrations_controller.rb', line 3 def index @migrations = runner.status @pending = runner.pending? end |
#rollback ⇒ Object
12 13 14 |
# File 'app/controllers/slash_migrate/migrations_controller.rb', line 12 def rollback finish(runner.rollback, "Rolled back the last migration.", "rails db:rollback") end |
#run ⇒ Object
8 9 10 |
# File 'app/controllers/slash_migrate/migrations_controller.rb', line 8 def run finish(runner.migrate, "Migrated.", "rails db:migrate") end |