Fix static analysys

This commit is contained in:
Shinya Maeda 2018-05-11 16:52:48 +09:00
parent 46fa3089c8
commit a74184eb5e
7 changed files with 9 additions and 9 deletions

View File

@ -15,7 +15,7 @@ module Ci
belongs_to :pipeline_schedule, class_name: 'Ci::PipelineSchedule' belongs_to :pipeline_schedule, class_name: 'Ci::PipelineSchedule'
has_internal_id :iid, scope: :project, presence: false, init: ->(s) do 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 end
has_many :stages has_many :stages

View File

@ -1,4 +1,4 @@
module IIDRoutes module IidRoutes
## ##
# This automagically enforces all related routes to use `iid` instead of `id` # 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, # If you want to use `iid` for some routes and `id` for other routes, this module should not to be included,

View File

@ -1,6 +1,6 @@
class Deployment < ActiveRecord::Base class Deployment < ActiveRecord::Base
include AtomicInternalId include AtomicInternalId
include IIDRoutes include IidRoutes
belongs_to :project, required: true belongs_to :project, required: true
belongs_to :environment, required: true belongs_to :environment, required: true

View File

@ -2,7 +2,7 @@ require 'carrierwave/orm/activerecord'
class Issue < ActiveRecord::Base class Issue < ActiveRecord::Base
include AtomicInternalId include AtomicInternalId
include IIDRoutes include IidRoutes
include Issuable include Issuable
include Noteable include Noteable
include Referable include Referable

View File

@ -1,6 +1,6 @@
class MergeRequest < ActiveRecord::Base class MergeRequest < ActiveRecord::Base
include AtomicInternalId include AtomicInternalId
include IIDRoutes include IidRoutes
include Issuable include Issuable
include Noteable include Noteable
include Referable include Referable

View File

@ -9,7 +9,7 @@ class Milestone < ActiveRecord::Base
include CacheMarkdownField include CacheMarkdownField
include AtomicInternalId include AtomicInternalId
include IIDRoutes include IidRoutes
include Sortable include Sortable
include Referable include Referable
include StripAttribute include StripAttribute