feat: Custom Attributes for contacts (#1158)

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
Sojan Jose
2020-08-21 19:30:27 +05:30
committed by GitHub
parent 507b40a51d
commit cdd385b269
18 changed files with 182 additions and 21 deletions

View File

@@ -4,6 +4,7 @@
#
# id :integer not null, primary key
# additional_attributes :jsonb
# custom_attributes :jsonb
# email :string
# identifier :string
# name :string
@@ -68,12 +69,12 @@ class Contact < ApplicationRecord
}
end
private
def downcase_email
email.downcase! if email.present?
end
private
def dispatch_create_event
Rails.configuration.dispatcher.dispatch(CONTACT_CREATED, Time.zone.now, contact: self)
end