chore: Enable the new Rubocop rules (#7122)
fixes: https://linear.app/chatwoot/issue/CW-1574/renable-the-disabled-rubocop-rules
This commit is contained in:
@@ -6,7 +6,7 @@ module Featurable
|
||||
check_for_column: false
|
||||
}.freeze
|
||||
|
||||
FEATURE_LIST = YAML.safe_load(File.read(Rails.root.join('config/features.yml'))).freeze
|
||||
FEATURE_LIST = YAML.safe_load(Rails.root.join('config/features.yml').read).freeze
|
||||
|
||||
FEATURES = FEATURE_LIST.each_with_object({}) do |feature, result|
|
||||
result[result.keys.size + 1] = "feature_#{feature['name']}".to_sym
|
||||
@@ -46,7 +46,7 @@ module Featurable
|
||||
end
|
||||
|
||||
def all_features
|
||||
FEATURE_LIST.map { |f| f['name'] }.index_with do |feature_name|
|
||||
FEATURE_LIST.pluck('name').index_with do |feature_name|
|
||||
feature_enabled?(feature_name)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -233,8 +233,8 @@ class Conversation < ApplicationRecord
|
||||
|
||||
def allowed_keys?
|
||||
(
|
||||
(previous_changes.keys & %w[team_id assignee_id status snoozed_until custom_attributes label_list first_reply_created_at priority]).present? ||
|
||||
(previous_changes['additional_attributes'].present? && (previous_changes['additional_attributes'][1].keys & %w[conversation_language]).present?)
|
||||
previous_changes.keys.intersect?(%w[team_id assignee_id status snoozed_until custom_attributes label_list first_reply_created_at priority]) ||
|
||||
(previous_changes['additional_attributes'].present? && previous_changes['additional_attributes'][1].keys.intersect?(%w[conversation_language]))
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class InstallationConfig < ApplicationRecord
|
||||
# https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017
|
||||
# FIX ME : fixes breakage of installation config. we need to migrate.
|
||||
# Fix configuration in application.rb
|
||||
serialize :serialized_value, HashWithIndifferentAccess
|
||||
serialize :serialized_value, ActiveSupport::HashWithIndifferentAccess
|
||||
|
||||
before_validation :set_lock
|
||||
validates :name, presence: true
|
||||
|
||||
Reference in New Issue
Block a user