discourse/app/serializers/email_log_serializer.rb

18 lines
431 B
Ruby
Raw Normal View History

2013-02-05 14:16:51 -05:00
class EmailLogSerializer < ApplicationSerializer
include EmailLogsMixin
2013-02-07 10:45:24 -05:00
attributes :reply_key,
2016-05-02 17:15:32 -04:00
:bounced
2013-02-05 14:16:51 -05:00
has_one :user, serializer: BasicUserSerializer, embed: :objects
def include_reply_key?
reply_keys = @options[:reply_keys]
reply_keys.present? && reply_keys[[object.post_id, object.user_id]]
end
def reply_key
@options[:reply_keys][[object.post_id, object.user_id]].delete("-")
end
2013-02-05 14:16:51 -05:00
end