Sha256: 36241f2e4413abec959791a049b3b584857344989f104082aa45125e2451707e
Contents?: true
Size: 682 Bytes
Versions: 149
Compression:
Stored size: 682 Bytes
Contents
# frozen_string_literal: true 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
149 entries across 149 versions & 1 rubygems