feat: Add contact_type attribute to contact model (#8768)

This commit is contained in:
Muhsin Keloth
2024-01-24 12:26:47 +05:30
committed by GitHub
parent 232369cd5c
commit 143299f138
3 changed files with 10 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
#
# id :integer not null, primary key
# additional_attributes :jsonb
# contact_type :integer default("visitor")
# custom_attributes :jsonb
# email :string
# identifier :string
@@ -55,6 +56,8 @@ class Contact < ApplicationRecord
after_update_commit :dispatch_update_event
after_destroy_commit :dispatch_destroy_event
enum contact_type: { visitor: 0, lead: 1, customer: 2 }
scope :order_on_last_activity_at, lambda { |direction|
order(
Arel::Nodes::SqlLiteral.new(