diff --git a/app/models/contact.rb b/app/models/contact.rb index fca06fa9e..2caeea4cf 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -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