2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-08-14 23:05:53 +08:00
|
|
|
class ScreenedEmailSerializer < ApplicationSerializer
|
2013-08-02 09:30:13 +08:00
|
|
|
attributes :email,
|
|
|
|
:action,
|
|
|
|
:match_count,
|
|
|
|
:last_match_at,
|
2013-08-23 07:04:17 +08:00
|
|
|
:created_at,
|
2014-06-02 14:52:43 +08:00
|
|
|
:ip_address,
|
|
|
|
:id
|
2013-08-14 23:05:53 +08:00
|
|
|
|
2013-08-02 09:30:13 +08:00
|
|
|
def action
|
2013-08-14 23:05:53 +08:00
|
|
|
ScreenedEmail.actions.key(object.action_type).to_s
|
2013-08-02 09:30:13 +08:00
|
|
|
end
|
2013-11-06 04:00:47 +08:00
|
|
|
|
|
|
|
def ip_address
|
|
|
|
object.ip_address.try(:to_s)
|
|
|
|
end
|
|
|
|
|
2013-08-02 09:30:13 +08:00
|
|
|
end
|