Merge pull request #5722 from consuldemocracy/dependabot/bundler/rubocop-rails-2.26.2
Bump rubocop-rails from 2.25.1 to 2.26.2
This commit is contained in:
@@ -370,6 +370,9 @@ Rails/ActiveRecordCallbacksOrder:
|
||||
Rails/AddColumnIndex:
|
||||
Enabled: true
|
||||
|
||||
Rails/CompactBlank:
|
||||
Enabled: true
|
||||
|
||||
Rails/CreateTableWithTimestamps:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
@@ -391,6 +394,12 @@ Rails/DynamicFindBy:
|
||||
- find_by_slug_or_id!
|
||||
- find_by_manager_login
|
||||
|
||||
Rails/EnumHash:
|
||||
Enabled: true
|
||||
|
||||
Rails/EnumSyntax:
|
||||
Enabled: true
|
||||
|
||||
Rails/EnumUniqueness:
|
||||
Enabled: true
|
||||
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -102,7 +102,7 @@ group :development do
|
||||
gem "rubocop-capybara", "~> 2.21.0", require: false
|
||||
gem "rubocop-factory_bot", "~> 2.26.1", require: false
|
||||
gem "rubocop-performance", "~> 1.22.1", require: false
|
||||
gem "rubocop-rails", "~> 2.25.1", require: false
|
||||
gem "rubocop-rails", "~> 2.26.2", require: false
|
||||
gem "rubocop-rspec", "~> 3.1.0", require: false
|
||||
gem "rubocop-rspec_rails", "~> 2.30.0", require: false
|
||||
gem "rvm1-capistrano3", "~> 1.4.0", require: false
|
||||
|
||||
@@ -557,10 +557,10 @@ GEM
|
||||
rubocop-performance (1.22.1)
|
||||
rubocop (>= 1.48.1, < 2.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
rubocop-rails (2.25.1)
|
||||
rubocop-rails (2.26.2)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.33.0, < 2.0)
|
||||
rubocop (>= 1.52.0, < 2.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
rubocop-rspec (3.1.0)
|
||||
rubocop (~> 1.61)
|
||||
@@ -772,7 +772,7 @@ DEPENDENCIES
|
||||
rubocop-capybara (~> 2.21.0)
|
||||
rubocop-factory_bot (~> 2.26.1)
|
||||
rubocop-performance (~> 1.22.1)
|
||||
rubocop-rails (~> 2.25.1)
|
||||
rubocop-rails (~> 2.26.2)
|
||||
rubocop-rspec (~> 3.1.0)
|
||||
rubocop-rspec_rails (~> 2.30.0)
|
||||
rvm1-capistrano3 (~> 1.4.0)
|
||||
|
||||
@@ -7,7 +7,7 @@ module Header
|
||||
(t("#{namespace}.header.title", default: "") unless skip_section_title),
|
||||
strip_tags(title),
|
||||
setting["org_name"]
|
||||
].reject(&:blank?).join(" - ")
|
||||
].compact_blank.join(" - ")
|
||||
end
|
||||
|
||||
heading_tag = if %w[admin management moderation sdg_management valuation].include?(namespace)
|
||||
|
||||
@@ -4,7 +4,7 @@ class SDG::Goals::PlainTagListComponent < ApplicationComponent
|
||||
private
|
||||
|
||||
def tags
|
||||
[*goal_tags, see_more_link].select(&:present?)
|
||||
[*goal_tags, see_more_link].compact_blank
|
||||
end
|
||||
|
||||
def goal_tags
|
||||
|
||||
@@ -4,7 +4,7 @@ class SDG::Targets::PlainTagListComponent < ApplicationComponent
|
||||
private
|
||||
|
||||
def tags
|
||||
[*target_tags, see_more_link].select(&:present?)
|
||||
[*target_tags, see_more_link].compact_blank
|
||||
end
|
||||
|
||||
def target_tags
|
||||
|
||||
@@ -13,7 +13,7 @@ class Shared::LinkListComponent < ApplicationComponent
|
||||
private
|
||||
|
||||
def present_links
|
||||
links.select(&:present?)
|
||||
links.compact_blank
|
||||
end
|
||||
|
||||
def list_items
|
||||
|
||||
@@ -9,7 +9,7 @@ class Dashboard::Action < ApplicationRecord
|
||||
class_name: "Dashboard::ExecutedAction"
|
||||
has_many :proposals, through: :executed_actions
|
||||
|
||||
enum action_type: [:proposed_action, :resource]
|
||||
enum :action_type, { proposed_action: 0, resource: 1 }
|
||||
|
||||
validates :title, presence: true, allow_blank: false, length: { in: 4..80 }
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class Poll
|
||||
validates :date, presence: true, uniqueness: { scope: [:officer_id, :booth_id, :task] }
|
||||
validates :task, presence: true
|
||||
|
||||
enum task: { vote_collection: 0, recount_scrutiny: 1 }
|
||||
enum :task, { vote_collection: 0, recount_scrutiny: 1 }
|
||||
|
||||
scope :current, -> { where(date: Date.current) }
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ class ProgressBar < ApplicationRecord
|
||||
self.inheritance_column = nil
|
||||
RANGE = (0..100)
|
||||
|
||||
enum kind: %i[primary secondary]
|
||||
enum :kind, { primary: 0, secondary: 1 }
|
||||
|
||||
belongs_to :progressable, polymorphic: true
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class SDG::Phase < ApplicationRecord
|
||||
include Cardable
|
||||
enum kind: %w[sensitization planning monitoring]
|
||||
enum :kind, { sensitization: 0, planning: 1, monitoring: 2 }
|
||||
validates :kind, presence: true, uniqueness: true
|
||||
|
||||
def self.[](kind)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Tenant < ApplicationRecord
|
||||
enum schema_type: %w[subdomain domain]
|
||||
enum :schema_type, { subdomain: 0, domain: 1 }
|
||||
|
||||
validates :schema,
|
||||
presence: true,
|
||||
|
||||
@@ -3,7 +3,7 @@ class VotationType < ApplicationRecord
|
||||
|
||||
QUESTIONABLE_TYPES = %w[Poll::Question].freeze
|
||||
|
||||
enum vote_type: %w[unique multiple]
|
||||
enum :vote_type, { unique: 0, multiple: 1 }
|
||||
|
||||
validates :questionable, presence: true
|
||||
validates :questionable_type, inclusion: { in: ->(*) { QUESTIONABLE_TYPES }}
|
||||
|
||||
Reference in New Issue
Block a user