Commit 5e2219db authored by Pawel Chojnacki's avatar Pawel Chojnacki

Fix unreversible migration, and small rubocop warnings

parent d3e794e2
...@@ -5,7 +5,11 @@ class AddCreatedAtIndexToDeployments < ActiveRecord::Migration ...@@ -5,7 +5,11 @@ class AddCreatedAtIndexToDeployments < ActiveRecord::Migration
disable_ddl_transaction! disable_ddl_transaction!
def change def up
add_concurrent_index :deployments, :created_at add_concurrent_index :deployments, :created_at
end end
def down
remove_index :deployments, :created_at
end
end end
...@@ -20,7 +20,7 @@ describe Projects::DeploymentsController do ...@@ -20,7 +20,7 @@ describe Projects::DeploymentsController do
create(:deployment, environment: environment, created_at: 7.hours.ago) create(:deployment, environment: environment, created_at: 7.hours.ago)
create(:deployment, environment: environment) 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 expect(response).to be_ok
...@@ -41,7 +41,7 @@ describe Projects::DeploymentsController do ...@@ -41,7 +41,7 @@ describe Projects::DeploymentsController do
end end
end end
def environment_params(opts={}) def environment_params(opts = {})
opts.reverse_merge(namespace_id: project.namespace, project_id: project, environment_id: environment.id) opts.reverse_merge(namespace_id: project.namespace, project_id: project, environment_id: environment.id)
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment