feat: add model

This commit is contained in:
Shivam Mishra
2023-06-02 17:45:25 +05:30
parent 4be26f7470
commit b493b0f885
+39
View File
@@ -0,0 +1,39 @@
# == Schema Information
#
# Table name: conversation_with_labels
#
# id :integer
# additional_attributes :jsonb
# agent_last_seen_at :datetime
# assignee_last_seen_at :datetime
# contact_last_seen_at :datetime
# custom_attributes :jsonb
# first_reply_created_at :datetime
# identifier :string
# labels_array :string is an Array
# last_activity_at :datetime
# priority :integer
# snoozed_until :datetime
# status :integer
# uuid :uuid
# created_at :datetime
# updated_at :datetime
# account_id :integer
# assignee_id :integer
# campaign_id :bigint
# contact_id :bigint
# contact_inbox_id :bigint
# display_id :integer
# inbox_id :integer
# team_id :bigint
#
class ConversationWithLabel < ApplicationRecord
def self.refresh
# https://github.com/scenic-views/scenic#what-about-materialized-views
Scenic.database.refresh_materialized_view(table_name, concurrently: true, cascade: false)
end
def readonly?
true
end
end