feat: move resolved contacts to a scope
This commit is contained in:
@@ -68,6 +68,8 @@ class Contact < ApplicationRecord
|
||||
|
||||
enum contact_type: { visitor: 0, lead: 1, customer: 2 }
|
||||
|
||||
scope :resolved_contacts, -> { where("contacts.email <> '' OR contacts.phone_number <> '' OR contacts.identifier <> ''") }
|
||||
|
||||
scope :order_on_last_activity_at, lambda { |direction|
|
||||
order(
|
||||
Arel::Nodes::SqlLiteral.new(
|
||||
@@ -164,10 +166,6 @@ class Contact < ApplicationRecord
|
||||
}
|
||||
end
|
||||
|
||||
def self.resolved_contacts
|
||||
where("contacts.email <> '' OR contacts.phone_number <> '' OR contacts.identifier <> ''")
|
||||
end
|
||||
|
||||
def discard_invalid_attrs
|
||||
phone_number_format
|
||||
email_format
|
||||
|
||||
Reference in New Issue
Block a user