ip_block_serializer.rb 270 B

1234567891011121314
  1. # frozen_string_literal: true
  2. class REST::Admin::IpBlockSerializer < ActiveModel::Serializer
  3. attributes :id, :ip, :severity, :comment,
  4. :created_at, :expires_at
  5. def id
  6. object.id.to_s
  7. end
  8. def ip
  9. "#{object.ip}/#{object.ip.prefix}"
  10. end
  11. end