Commit 7c53fcf1 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Adjust for new static-analysis failures

parent 397d3fd7
...@@ -37,8 +37,8 @@ module Gitlab ...@@ -37,8 +37,8 @@ module Gitlab
def perform_rename(routable, old_full_path, new_full_path) def perform_rename(routable, old_full_path, new_full_path)
# skips callbacks & validations # skips callbacks & validations
new_path = new_full_path.split('/').last new_path = new_full_path.split('/').last
routable.class.where(id: routable). routable.class.where(id: routable)
update_all(path: new_path) .update_all(path: new_path)
rename_routes(old_full_path, new_full_path) rename_routes(old_full_path, new_full_path)
end end
......
...@@ -55,9 +55,9 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1, :truncate do ...@@ -55,9 +55,9 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1, :truncate do
describe '#revert_renames' do describe '#revert_renames' do
it 'renames namespaces' do it 'renames namespaces' do
rename_namespaces = double rename_namespaces = double
expect(described_class::RenameNamespaces). expect(described_class::RenameNamespaces)
to receive(:new).with([], subject). .to receive(:new).with([], subject)
and_return(rename_namespaces) .and_return(rename_namespaces)
expect(rename_namespaces).to receive(:revert_renames) expect(rename_namespaces).to receive(:revert_renames)
subject.revert_renames subject.revert_renames
...@@ -65,9 +65,9 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1, :truncate do ...@@ -65,9 +65,9 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1, :truncate do
it 'renames projects' do it 'renames projects' do
rename_projects = double rename_projects = double
expect(described_class::RenameProjects). expect(described_class::RenameProjects)
to receive(:new).with([], subject). .to receive(:new).with([], subject)
and_return(rename_projects) .and_return(rename_projects)
expect(rename_projects).to receive(:revert_renames) expect(rename_projects).to receive(:revert_renames)
subject.revert_renames subject.revert_renames
......
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