Sha256: c0874b79bbc853c5b76a817d1672aafc304ea1b09c813e3728580467238f1efb
Contents?: true
Size: 411 Bytes
Versions: 19
Compression:
Stored size: 411 Bytes
Contents
module Spina::Api class ResourceSerializer < BaseSerializer set_type :resource attributes :name, :label, :view_template, :order_by, :slug has_many :pages, lazy_load_data: true, links: { self: -> (object) { api_resource_path(object.id) }, related: -> (object) { api_resource_pages_path(object.id) } }, meta: -> (resource) { {count: resource.pages.live.length} } end end
Version data entries
19 entries across 19 versions & 1 rubygems