2019-08-14 09:48:44 +00:00
|
|
|
class ApplicationRecord < ActiveRecord::Base
|
2020-08-25 17:34:02 +00:00
|
|
|
include Events::Types
|
2019-08-14 09:48:44 +00:00
|
|
|
self.abstract_class = true
|
2020-08-25 17:34:02 +00:00
|
|
|
|
|
|
|
# the models that exposed in email templates through liquid
|
2020-08-06 09:51:06 +00:00
|
|
|
DROPPABLES = %w[Account Channel Conversation Inbox User].freeze
|
|
|
|
|
2020-08-25 17:34:02 +00:00
|
|
|
# ModelDrop class should exist in app/drops
|
2020-08-06 09:51:06 +00:00
|
|
|
def to_drop
|
|
|
|
return unless DROPPABLES.include?(self.class.name)
|
|
|
|
|
|
|
|
"#{self.class.name}Drop".constantize.new(self)
|
|
|
|
end
|
2019-08-14 09:48:44 +00:00
|
|
|
end
|