Class: ActiveRecordMigrationUi::MigrationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ActiveRecordMigrationUi::MigrationsController
- Defined in:
- app/controllers/active_record_migration_ui/migrations_controller.rb
Class Method Summary collapse
-
.call(env) ⇒ Object
Rack Middleware uses this method in order to run the index action.
Instance Method Summary collapse
Class Method Details
.call(env) ⇒ Object
Rack Middleware uses this method in order to run the index action.
6 7 8 |
# File 'app/controllers/active_record_migration_ui/migrations_controller.rb', line 6 def self.call(env) action(:index).call(env) end |
Instance Method Details
#index ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/active_record_migration_ui/migrations_controller.rb', line 10 def index respond_to do |format| format.html format.json do interactor = FindAllPendingMigrationScripts.call if interactor.failure? render json: interactor.errors, status: :unprocessable_entity else render json: interactor.scripts, status: :ok end end end end |