Revert "chore: Upgrade Rails to 7.2.2 and update Gemfile dependencies (#11037)"

This reverts commit ef6ba8aabd.
This commit is contained in:
Sojan Jose
2026-02-03 21:09:42 -08:00
parent ef6ba8aabd
commit 9eb3ee44a8
28 changed files with 311 additions and 360 deletions

View File

@@ -28,7 +28,7 @@ class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::Bas
end
def create_issue
issue = linear_processor_service.create_issue(permitted_params.to_h.stringify_keys, Current.user)
issue = linear_processor_service.create_issue(permitted_params, Current.user)
if issue[:error]
render json: { error: issue[:error] }, status: :unprocessable_entity
else

View File

@@ -20,9 +20,7 @@ class SuperAdmin::InstanceStatusesController < SuperAdmin::ApplicationController
end
def instance_meta
migrations_paths = ActiveRecord::Migrator.migrations_paths
migrations_context = ActiveRecord::MigrationContext.new(migrations_paths)
@metrics['Database Migrations'] = migrations_context.needs_migration? ? 'pending' : 'completed'
@metrics['Database Migrations'] = ActiveRecord::Base.connection.migration_context.needs_migration? ? 'pending' : 'completed'
end
def chatwoot_version

View File

@@ -19,11 +19,6 @@ 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
#
# Note: This whole thing is because we store the installation config serialized in YAML in Database
# This serialized version stores HashWithIndifferentAccess, We could avoid all this complexity if we store the value as JSONB
# We could also avoid this issue if we migrate the installation config to JSONB
# We should do this migration at some point in time.
serialize :serialized_value, coder: YAML, type: ActiveSupport::HashWithIndifferentAccess
before_validation :set_lock

View File

@@ -18,7 +18,7 @@ class Integrations::Hook < ApplicationRecord
include Reauthorizable
attr_readonly :app_id, :account_id, :inbox_id, :hook_type
before_validation :ensure_hook_type, on: :create
before_validation :ensure_hook_type
after_create :trigger_setup_if_crm
# TODO: Remove guard once encryption keys become mandatory (target 3-4 releases out).
@@ -86,9 +86,7 @@ class Integrations::Hook < ApplicationRecord
end
def ensure_hook_type
return if app.blank?
self.hook_type = app.params[:hook_type]
self.hook_type = app.params[:hook_type] if app.present?
end
def validate_settings_json_schema

View File

@@ -421,8 +421,6 @@ class Message < ApplicationRecord
end
def reindex_for_search
return unless respond_to?(:reindex)
reindex(mode: :async)
end
end

View File

@@ -69,7 +69,7 @@ class User < ApplicationRecord
# TODO: remove in a future version once online status is moved to account users
# remove the column availability from users
enum :availability, { online: 0, offline: 1, busy: 2 }
enum availability: { online: 0, offline: 1, busy: 2 }
# The validation below has been commented out as it does not
# work because :validatable in devise overrides this.
@@ -77,7 +77,7 @@ class User < ApplicationRecord
validates :email, presence: true
serialize :otp_backup_codes, coder: JSON, type: Array
serialize :otp_backup_codes, type: Array
# Encrypt sensitive MFA fields
encrypts :otp_secret, deterministic: true
@@ -88,7 +88,7 @@ class User < ApplicationRecord
accepts_nested_attributes_for :account_users
has_many :assigned_conversations, foreign_key: 'assignee_id', class_name: 'Conversation', dependent: :nullify, inverse_of: :assignee
alias conversations assigned_conversations
alias_attribute :conversations, :assigned_conversations
has_many :csat_survey_responses, foreign_key: 'assigned_agent_id', dependent: :nullify, inverse_of: :assigned_agent
has_many :reviewed_csat_survey_responses, foreign_key: 'review_notes_updated_by_id', class_name: 'CsatSurveyResponse',
dependent: :nullify, inverse_of: :review_notes_updated_by

View File

@@ -82,7 +82,7 @@ class Crm::Leadsquared::SetupService
end
def update_hook_settings(params)
@hook.settings = @hook.settings.merge(params.stringify_keys)
@hook.settings = @hook.settings.merge(params)
@hook.save!
end