This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/serializers/screened_ip_address_serializer.rb

18 lines
355 B
Ruby

class ScreenedIpAddressSerializer < ApplicationSerializer
attributes :id,
:ip_address,
:action_name,
:match_count,
:last_match_at,
:created_at
def action_name
ScreenedIpAddress.actions.key(object.action_type).to_s
end
def ip_address
object.ip_address_with_mask
end
end