2022-09-22 17:07:08 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class LabelPrinterSerializer < ActiveModel::Serializer
|
|
|
|
include Rails.application.routes.url_helpers
|
2022-09-28 19:25:55 +08:00
|
|
|
include ApplicationHelper
|
2022-09-22 17:07:08 +08:00
|
|
|
|
2022-10-12 22:56:58 +08:00
|
|
|
attributes :name, :display_name, :description, :type_of, :language_type, :status
|
2022-09-22 17:07:08 +08:00
|
|
|
|
|
|
|
def urls
|
|
|
|
{
|
|
|
|
}
|
|
|
|
end
|
2022-09-28 19:25:55 +08:00
|
|
|
|
|
|
|
def display_name
|
|
|
|
object.description.present? ? sanitize_input("#{object.name} • #{object.description}") : sanitize_input(object.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def status
|
|
|
|
object.status.dasherize
|
|
|
|
end
|
2022-09-22 17:07:08 +08:00
|
|
|
end
|