about summary refs log tree commit diff
path: root/app/serializers/rest/admin/existing_domain_block_error_serializer.rb
blob: 629566daddd3d5252de20cf32b595c9b0952b6fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class REST::Admin::ExistingDomainBlockErrorSerializer < ActiveModel::Serializer
  attributes :error

  has_one :existing_domain_block, serializer: REST::Admin::DomainBlockSerializer

  def error
    I18n.t('admin.domain_blocks.existing_domain_block', name: existing_domain_block.domain)
  end

  def existing_domain_block
    object
  end
end