Fix unreversible migration, and small rubocop warnings

This commit is contained in:
Pawel Chojnacki 2017-03-28 15:54:02 +02:00
parent d3e794e26f
commit 5e2219db48
2 changed files with 7 additions and 3 deletions

View File

@ -5,7 +5,11 @@ class AddCreatedAtIndexToDeployments < ActiveRecord::Migration
disable_ddl_transaction!
def change
def up
add_concurrent_index :deployments, :created_at
end
def down
remove_index :deployments, :created_at
end
end

View File

@ -20,7 +20,7 @@ describe Projects::DeploymentsController do
create(:deployment, environment: environment, created_at: 7.hours.ago)
create(:deployment, environment: environment)
get :index, environment_params(:after => 8.hours.ago)
get :index, environment_params(after: 8.hours.ago)
expect(response).to be_ok
@ -41,7 +41,7 @@ describe Projects::DeploymentsController do
end
end
def environment_params(opts={})
def environment_params(opts = {})
opts.reverse_merge(namespace_id: project.namespace, project_id: project, environment_id: environment.id)
end
end