From 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Thu, 28 Feb 2019 19:57:34 +0100 Subject: Ran standardrb --fix on the whole codebase Inspired by https://twitter.com/searls/status/1101137953743613952 I decided to try https://github.com/testdouble/standard on our codebase. It's opinionated, but at least it's a _standard_. --- app/models/commit_status.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app/models/commit_status.rb') diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 7f6562b63e5..012085bebd8 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -7,12 +7,12 @@ class CommitStatus < ActiveRecord::Base include Presentable include EnumWithNil - self.table_name = 'ci_builds' + self.table_name = "ci_builds" belongs_to :user belongs_to :project - belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :commit_id - belongs_to :auto_canceled_by, class_name: 'Ci::Pipeline' + belongs_to :pipeline, class_name: "Ci::Pipeline", foreign_key: :commit_id + belongs_to :auto_canceled_by, class_name: "Ci::Pipeline" delegate :commit, to: :pipeline delegate :sha, :short_sha, to: :pipeline @@ -40,7 +40,7 @@ class CommitStatus < ActiveRecord::Base scope :ordered, -> { order(:name) } scope :latest_ordered, -> { latest.ordered.includes(project: :namespace) } scope :retried_ordered, -> { retried.ordered.includes(project: :namespace) } - scope :after_stage, -> (index) { where('stage_idx > ?', index) } + scope :after_stage, ->(index) { where("stage_idx > ?", index) } scope :processables, -> { where(type: %w[Ci::Build Ci::Bridge]) } # We use `CommitStatusEnums.failure_reasons` here so that EE can more easily @@ -55,7 +55,7 @@ class CommitStatus < ActiveRecord::Base before_create unless: :importing? do # rubocop: disable CodeReuse/ServiceClass Ci::EnsureStageService.new(project, user).execute(self) do |stage| - self.run_after_commit { StageUpdateWorker.perform_async(stage.id) } + run_after_commit { StageUpdateWorker.perform_async(stage.id) } end # rubocop: enable CodeReuse/ServiceClass end @@ -145,7 +145,7 @@ class CommitStatus < ActiveRecord::Base end def group_name - name.to_s.gsub(%r{\d+[\s:/\\]+\d+\s*}, '').strip + name.to_s.gsub(%r{\d+[\s:/\\]+\d+\s*}, "").strip end def failed_but_allowed? @@ -192,7 +192,7 @@ class CommitStatus < ActiveRecord::Base def sortable_name name.to_s.split(/(\d+)/).map do |v| - v =~ /\d+/ ? v.to_i : v + /\d+/.match?(v) ? v.to_i : v end end end -- cgit v1.2.1