Sha256: b4a970d2d54f1e013638a72bfc99c2f754f009884e492cdf54ca424e3d19b917

Contents?: true

Size: 683 Bytes

Versions: 1

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true

class Address < ApplicationRecord
  EXCLUDE_GR_FIELDS = %i[id created_at updated_at global_registry_id person_id address1].freeze
  belongs_to :person, class_name: 'Namespaced::Person', inverse_of: :addresses
  global_registry_bindings parent_association: :person,
                           exclude: proc { |_type, _model| EXCLUDE_GR_FIELDS },
                           fields: :global_registry_extra_fields,
                           include_all_columns: true

  alias_attribute :line1, :address1
  alias_attribute :postal_code, :zip

  def global_registry_extra_fields(_type)
    { line1: :string, line2: :string, postal_code: :string }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
global-registry-bindings-0.1.3 spec/internal/app/models/address.rb