Sha256: c6d6b6dff6de2b325b4aa8a38c04eb940772820d823f8e3eeecd82397cbb5c4f
Contents?: true
Size: 651 Bytes
Versions: 27
Compression:
Stored size: 651 Bytes
Contents
require_dependency "renalware/directory" module Renalware module Directory class Person < ApplicationRecord include Personable include Accountable has_one :address, as: :addressable accepts_nested_attributes_for :address scope :ordered, -> { order(:family_name, :given_name) } scope :with_address, -> { includes(:address) } def self.policy_class BasePolicy end def self.build(attributes = {}) person = new(attributes) person.build_address person end def to_s [family_name, given_name].compact.join(", ") end end end end
Version data entries
27 entries across 27 versions & 1 rubygems