2013-10-21 14:49:51 -04:00
|
|
|
class ScreenedIpAddressSerializer < ApplicationSerializer
|
2013-10-22 16:30:30 -04:00
|
|
|
attributes :id,
|
|
|
|
:ip_address,
|
2013-10-24 17:18:10 -04:00
|
|
|
:action_name,
|
2013-10-21 14:49:51 -04:00
|
|
|
:match_count,
|
|
|
|
:last_match_at,
|
|
|
|
:created_at
|
|
|
|
|
2013-10-24 17:18:10 -04:00
|
|
|
def action_name
|
2013-10-21 14:49:51 -04:00
|
|
|
ScreenedIpAddress.actions.key(object.action_type).to_s
|
|
|
|
end
|
|
|
|
|
2013-11-05 15:00:47 -05:00
|
|
|
def ip_address
|
|
|
|
object.ip_address.try(:to_s)
|
|
|
|
end
|
|
|
|
|
2013-10-21 14:49:51 -04:00
|
|
|
end
|