Sha256: cfdc84b83a3877023c033a9db6c6bbf8b323b3db103ff2e5b76c2cd70458f7bc

Contents?: true

Size: 671 Bytes

Versions: 16

Compression:

Stored size: 671 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: :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

16 entries across 16 versions & 1 rubygems

Version Path
global-registry-bindings-0.6.2 spec/internal/app/models/address.rb
global-registry-bindings-0.6.1 spec/internal/app/models/address.rb
global-registry-bindings-0.6.0 spec/internal/app/models/address.rb
global-registry-bindings-0.5.0 spec/internal/app/models/address.rb
global-registry-bindings-0.4.0 spec/internal/app/models/address.rb
global-registry-bindings-0.3.3 spec/internal/app/models/address.rb
global-registry-bindings-0.3.2 spec/internal/app/models/address.rb
global-registry-bindings-0.3.1 spec/internal/app/models/address.rb
global-registry-bindings-0.3.0 spec/internal/app/models/address.rb
global-registry-bindings-0.2.0 spec/internal/app/models/address.rb
global-registry-bindings-0.1.9 spec/internal/app/models/address.rb
global-registry-bindings-0.1.8 spec/internal/app/models/address.rb
global-registry-bindings-0.1.7 spec/internal/app/models/address.rb
global-registry-bindings-0.1.6 spec/internal/app/models/address.rb
global-registry-bindings-0.1.5 spec/internal/app/models/address.rb
global-registry-bindings-0.1.4 spec/internal/app/models/address.rb