Sha256: b28e4e7a336e14251e8007a849d41fa40caa6ea5632d759007c3c08bc7295019
Contents?: true
Size: 1.28 KB
Versions: 15
Compression:
Stored size: 1.28 KB
Contents
# frozen_string_literal: true require_relative '../reference/serializer' require_relative '../check_line_item/serializer' module LedgerSync module NetSuite class Check class Serializer < NetSuite::Serializer attribute :memo attribute :trandate references_one :account, serializer: Reference::Serializer, if: :account_present? references_one :department, serializer: Reference::Serializer, if: :department_present? references_one :currency, serializer: Reference::Serializer, if: :currency_present? references_one :entity, serializer: Reference::Serializer references_many 'expense.items', resource_attribute: :line_items, serializer: CheckLineItem::Serializer def account_present?(args = {}) resource = args.fetch(:resource) resource.account.present? end def department_present?(args = {}) resource = args.fetch(:resource) resource.department.present? end def currency_present?(args = {}) resource = args.fetch(:resource) resource.currency.present? end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems