mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 15:49:55 +08:00
3083657358
FEATURE: new incoming_email model FEATURE: infinite scrolling in emails admin FEATURE: new 'emails:import' rake task
33 lines
624 B
Ruby
33 lines
624 B
Ruby
class IncomingEmailSerializer < ApplicationSerializer
|
|
|
|
attributes :id,
|
|
:created_at,
|
|
:from_address,
|
|
:to_addresses,
|
|
:cc_addresses,
|
|
:subject,
|
|
:error,
|
|
:post_url
|
|
|
|
has_one :user, serializer: BasicUserSerializer, embed: :objects
|
|
|
|
def post_url
|
|
object.post.url
|
|
end
|
|
|
|
def include_post_url?
|
|
object.post.present?
|
|
end
|
|
|
|
def to_addresses
|
|
return if object.to_addresses.blank?
|
|
object.to_addresses.split(";")
|
|
end
|
|
|
|
def cc_addresses
|
|
return if object.cc_addresses.blank?
|
|
object.cc_addresses.split(";")
|
|
end
|
|
|
|
end
|