fix: preserve annotaterb output and cover installation config defaults

This commit is contained in:
Sojan Jose
2026-03-23 21:23:30 -07:00
parent efaa3c07df
commit 646d0bf749
6 changed files with 53 additions and 35 deletions
+2 -2
View File
@@ -41,8 +41,8 @@
:active_admin: false
:command:
:debug: false
:hide_default_column_types: ''
:hide_limit_column_types: ''
:hide_default_column_types: json,jsonb,hstore
:hide_limit_column_types: integer,bigint,boolean
:timestamp_columns:
- created_at
- updated_at
+19 -15
View File
@@ -2,24 +2,28 @@
#
# Table name: csat_survey_responses
#
# id :bigint not null, primary key
# feedback_message :text
# rating :integer not null
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
# assigned_agent_id :bigint
# contact_id :bigint not null
# conversation_id :bigint not null
# message_id :bigint not null
# id :bigint not null, primary key
# csat_review_notes :text
# feedback_message :text
# rating :integer not null
# review_notes_updated_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
# assigned_agent_id :bigint
# contact_id :bigint not null
# conversation_id :bigint not null
# message_id :bigint not null
# review_notes_updated_by_id :bigint
#
# Indexes
#
# index_csat_survey_responses_on_account_id (account_id)
# index_csat_survey_responses_on_assigned_agent_id (assigned_agent_id)
# index_csat_survey_responses_on_contact_id (contact_id)
# index_csat_survey_responses_on_conversation_id (conversation_id)
# index_csat_survey_responses_on_message_id (message_id) UNIQUE
# index_csat_survey_responses_on_account_id (account_id)
# index_csat_survey_responses_on_assigned_agent_id (assigned_agent_id)
# index_csat_survey_responses_on_contact_id (contact_id)
# index_csat_survey_responses_on_conversation_id (conversation_id)
# index_csat_survey_responses_on_message_id (message_id) UNIQUE
# index_csat_survey_responses_on_review_notes_updated_by_id (review_notes_updated_by_id)
#
class CsatSurveyResponse < ApplicationRecord
belongs_to :account
+8 -7
View File
@@ -17,13 +17,14 @@
#
# Indexes
#
# index_reporting_events_on_account_id (account_id)
# index_reporting_events_on_conversation_id (conversation_id)
# index_reporting_events_on_created_at (created_at)
# index_reporting_events_on_inbox_id (inbox_id)
# index_reporting_events_on_name (name)
# index_reporting_events_on_user_id (user_id)
# reporting_events__account_id__name__created_at (account_id,name,created_at)
# index_reporting_events_for_response_distribution (account_id,name,inbox_id,created_at)
# index_reporting_events_on_account_id (account_id)
# index_reporting_events_on_conversation_id (conversation_id)
# index_reporting_events_on_created_at (created_at)
# index_reporting_events_on_inbox_id (inbox_id)
# index_reporting_events_on_name (name)
# index_reporting_events_on_user_id (user_id)
# reporting_events__account_id__name__created_at (account_id,name,created_at)
#
class ReportingEvent < ApplicationRecord
+11 -11
View File
@@ -2,17 +2,17 @@
#
# Table name: reporting_events_rollups
#
# id :bigint not null, primary key
# count :bigint default(0), not null
# date :date not null
# dimension_id :bigint not null
# dimension_type :string not null
# metric :string not null
# sum_value :float default(0.0), not null
# sum_value_business_hours :float default(0.0), not null
# created_at :datetime not null
# updated_at :datetime not null
# account_id :integer not null
# id :bigint not null, primary key
# count :bigint default(0), not null
# date :date not null
# dimension_type :string not null
# metric :string not null
# sum_value :float default(0.0), not null
# sum_value_business_hours :float default(0.0), not null
# created_at :datetime not null
# updated_at :datetime not null
# account_id :integer not null
# dimension_id :bigint not null
#
# Indexes
#
+1
View File
@@ -4,6 +4,7 @@
#
# id :bigint not null, primary key
# name :string
# secret :string
# subscriptions :jsonb
# url :text
# webhook_type :integer default("account_type")
+12
View File
@@ -3,5 +3,17 @@
require 'rails_helper'
RSpec.describe InstallationConfig do
subject(:installation_config) { described_class.new(name: 'INSTALLATION_NAME') }
it { is_expected.to validate_presence_of(:name) }
describe 'new record defaults' do
it 'initializes serialized_value with indifferent access' do
expect(installation_config.serialized_value).to eq({}.with_indifferent_access)
end
it 'returns nil for value before assignment' do
expect(installation_config.value).to be_nil
end
end
end