diff --git a/app/models/identifier.rb b/app/models/identifier.rb index 9b7236407a..c5b1b9794e 100644 --- a/app/models/identifier.rb +++ b/app/models/identifier.rb @@ -79,7 +79,7 @@ def value=(val) base += '/' unless base.ends_with?('/') super("#{base}#{val.to_s.strip}") else - super(val) + super end end # rubocop:enable Metrics/AbcSize diff --git a/app/models/language.rb b/app/models/language.rb index 3755e29bac..77eaa63c4d 100644 --- a/app/models/language.rb +++ b/app/models/language.rb @@ -55,7 +55,7 @@ def abbreviation=(value) value = '' if value.nil? value = value.downcase if value.blank? || value =~ /\A[a-z]{2}\Z/i - super(value) + super else super(LocaleService.to_i18n(locale: value).to_s) end diff --git a/app/models/org.rb b/app/models/org.rb index b56a40e0b1..e17756a5f0 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -141,7 +141,7 @@ class Org < ApplicationRecord before_validation :check_for_missing_logo_file # This gives all managed orgs api access whenever saved or updated. - before_save :ensure_api_access, if: ->(org) { org.managed? } + before_save :ensure_api_access, if: lambda(&:managed?) # If the physical logo file is no longer on disk we do not want it to prevent the # model from saving. This typically happens when you copy the database to another diff --git a/app/models/section.rb b/app/models/section.rb index 70e0c760a0..372a0913b8 100644 --- a/app/models/section.rb +++ b/app/models/section.rb @@ -68,7 +68,7 @@ class Section < ApplicationRecord def phase_id=(value) phase = Phase.where(id: value).first self.number = (phase.sections.where.not(id: id).maximum(:number).to_i + 1) if phase.present? - super(value) + super end # ===================== diff --git a/app/models/template.rb b/app/models/template.rb index 98de69ec8c..01805507bc 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -109,7 +109,7 @@ class Template < ApplicationRecord # overwriting the accessors. We want to ensure this template is published # before we remove the published_version # That being said, there's a potential race_condition where we have multiple-published-versions - after_update :reconcile_published, if: ->(template) { template.published? } + after_update :reconcile_published, if: lambda(&:published?) # ========== # = Scopes = diff --git a/app/policies/api/v0/guidance_group_policy.rb b/app/policies/api/v0/guidance_group_policy.rb index 2d6af19a8f..fee456881d 100644 --- a/app/policies/api/v0/guidance_group_policy.rb +++ b/app/policies/api/v0/guidance_group_policy.rb @@ -11,7 +11,7 @@ def initialize(user, guidance_group) raise Pundit::NotAuthorizedError, _('must have access to guidances api') end - super(user, guidance_group) + super end ## diff --git a/app/policies/api/v0/guidance_policy.rb b/app/policies/api/v0/guidance_policy.rb index a3853f6516..1f95de3605 100644 --- a/app/policies/api/v0/guidance_policy.rb +++ b/app/policies/api/v0/guidance_policy.rb @@ -11,7 +11,7 @@ def initialize(user, guidance) raise Pundit::NotAuthorizedError, _('must have access to guidances api') end - super(user, guidance) + super end ## diff --git a/app/policies/api/v0/plans_policy.rb b/app/policies/api/v0/plans_policy.rb index b1c313d7d7..4a1d48d1d2 100644 --- a/app/policies/api/v0/plans_policy.rb +++ b/app/policies/api/v0/plans_policy.rb @@ -11,7 +11,7 @@ def initialize(user, plan) raise Pundit::NotAuthorizedError, _('must have access to plans api') end - super(user, plan) + super end ## diff --git a/app/policies/api/v0/statistics_policy.rb b/app/policies/api/v0/statistics_policy.rb index 57996a7362..84aa7cd6e3 100644 --- a/app/policies/api/v0/statistics_policy.rb +++ b/app/policies/api/v0/statistics_policy.rb @@ -11,7 +11,7 @@ def initialize(user, statistic) raise Pundit::NotAuthorizedError, _('must have access to guidances api') end - super(user, statistic) + super end ## diff --git a/app/policies/api/v0/template_policy.rb b/app/policies/api/v0/template_policy.rb index 67f360ca13..81cc767a88 100644 --- a/app/policies/api/v0/template_policy.rb +++ b/app/policies/api/v0/template_policy.rb @@ -9,7 +9,7 @@ def initialize(user, template) raise Pundit::NotAuthorizedError, _('must have access to templates api') end - super(user, template) + super end ## diff --git a/app/policies/usage_policy.rb b/app/policies/usage_policy.rb index 298dcb9619..5404d72682 100644 --- a/app/policies/usage_policy.rb +++ b/app/policies/usage_policy.rb @@ -9,7 +9,7 @@ class UsagePolicy < Struct.new(:user, :usage) def initialize(user, usage) raise Pundit::NotAuthorizedError, 'must be logged in' unless user - super(user, usage) + super @user = user end diff --git a/config/initializers/new_framework_defaults_7_1.rb b/config/initializers/new_framework_defaults_7_1.rb index 4ba02970b6..ebedc26c8d 100644 --- a/config/initializers/new_framework_defaults_7_1.rb +++ b/config/initializers/new_framework_defaults_7_1.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # # This file eases your Rails 7.1 framework defaults upgrade. @@ -241,7 +243,6 @@ # this file): # config.active_support.cache_format_version = 7.1 - ### # Configure Action View to use HTML5 standards-compliant sanitizers when they are supported on your # platform. @@ -253,7 +254,6 @@ #++ # Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor - ### # Configure Action Text to use an HTML5 standards-compliant sanitizer when it is supported on your # platform. @@ -265,14 +265,12 @@ #++ # Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor - ### # Configure the log level used by the DebugExceptions middleware when logging # uncaught exceptions during requests. #++ # Rails.application.config.action_dispatch.debug_exception_log_level = :error - ### # Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5 # parsers.