Sha256: 0ece37f6374de5504c30d6245e2218e22797a67d5e93d41f8f40f5b4dc40f9ed

Contents?: true

Size: 670 Bytes

Versions: 3

Compression:

Stored size: 670 Bytes

Contents

require_dependency 'active_record_migration_ui/application_controller'

module ActiveRecordMigrationUi
  class MigrationsController < ApplicationController
    # Rack Middleware uses this method in order to run the index action.
    def self.call(env)
      action(:index).call(env)
    end

    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_record_migration_ui-0.1.2 app/controllers/active_record_migration_ui/migrations_controller.rb
active_record_migration_ui-0.1.1 app/controllers/active_record_migration_ui/migrations_controller.rb
active_record_migration_ui-0.1.0 app/controllers/active_record_migration_ui/migrations_controller.rb