summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-05-11 16:52:48 +0900
committerShinya Maeda <shinya@gitlab.com>2018-05-11 16:52:48 +0900
commita74184eb5e692ef77fe3be28b1f4a40549c8fcff (patch)
treedf33627128e07dd4389f94d0ddea301dfc560ca5
parent46fa3089c84642170d86799c4f60fe87507e575d (diff)
downloadgitlab-ce-a74184eb5e692ef77fe3be28b1f4a40549c8fcff.tar.gz
Fix static analysys
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--app/models/concerns/iid_routes.rb2
-rw-r--r--app/models/deployment.rb2
-rw-r--r--app/models/issue.rb2
-rw-r--r--app/models/merge_request.rb2
-rw-r--r--app/models/milestone.rb2
-rw-r--r--spec/lib/gitlab/ci/pipeline/chain/create_spec.rb6
7 files changed, 9 insertions, 9 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index e9a56525fde..accd0f11a9b 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -15,7 +15,7 @@ module Ci
belongs_to :pipeline_schedule, class_name: 'Ci::PipelineSchedule'
has_internal_id :iid, scope: :project, presence: false, init: ->(s) do
- s&.project&.pipelines&.maximum(:iid) || s&.project&.pipelines.count
+ s&.project&.pipelines&.maximum(:iid) || s&.project&.pipelines&.count
end
has_many :stages
diff --git a/app/models/concerns/iid_routes.rb b/app/models/concerns/iid_routes.rb
index 50957e0230d..246748cf52c 100644
--- a/app/models/concerns/iid_routes.rb
+++ b/app/models/concerns/iid_routes.rb
@@ -1,4 +1,4 @@
-module IIDRoutes
+module IidRoutes
##
# This automagically enforces all related routes to use `iid` instead of `id`
# If you want to use `iid` for some routes and `id` for other routes, this module should not to be included,
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index dac97676348..ac86e9e8de0 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -1,6 +1,6 @@
class Deployment < ActiveRecord::Base
include AtomicInternalId
- include IIDRoutes
+ include IidRoutes
belongs_to :project, required: true
belongs_to :environment, required: true
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 6d33a67845f..d0e8fe908e4 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -2,7 +2,7 @@ require 'carrierwave/orm/activerecord'
class Issue < ActiveRecord::Base
include AtomicInternalId
- include IIDRoutes
+ include IidRoutes
include Issuable
include Noteable
include Referable
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index a14681897fd..f42d432cc66 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -1,6 +1,6 @@
class MergeRequest < ActiveRecord::Base
include AtomicInternalId
- include IIDRoutes
+ include IidRoutes
include Issuable
include Noteable
include Referable
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index f143b8452a2..d05dcfd083a 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -9,7 +9,7 @@ class Milestone < ActiveRecord::Base
include CacheMarkdownField
include AtomicInternalId
- include IIDRoutes
+ include IidRoutes
include Sortable
include Referable
include StripAttribute
diff --git a/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
index b8ab0135092..9c0bedfb6b7 100644
--- a/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
@@ -41,13 +41,13 @@ describe Gitlab::Ci::Pipeline::Chain::Create do
it 'breaks the chain' do
expect(step.break?).to be true
end
-
+
it 'appends validation error' do
expect(pipeline.errors.to_a)
.to include /Failed to persist the pipeline/
end
end
-
+
context 'when ref is nil' do
let(:pipeline) do
build(:ci_pipeline, project: project, ref: nil)
@@ -64,7 +64,7 @@ describe Gitlab::Ci::Pipeline::Chain::Create do
before do
allow_any_instance_of(Ci::Pipeline).to receive(:ensure_project_iid!) { |p| p.send(:write_attribute, :iid, 1) }
create(:ci_pipeline, project: project)
-
+
step.perform!
end