Sha256: 35048c72d0d77e922a562d8e9807edb81c00538cf8ab638ab0a8237564f528b7
Contents?: true
Size: 713 Bytes
Versions: 3
Compression:
Stored size: 713 Bytes
Contents
module KirguduBase module Concerns::Models::PersonFullName extend ActiveSupport::Concern included do end def full_name fn = if self.respond_to?(:first_name) self.first_name.to_s elsif self.respond_to?(:firstname) self.firstname else "" end rescue "" ln = if self.respond_to?(:last_name) self.last_name.to_s elsif self.respond_to?(:lastname) self.lastname.to_s else "" end rescue "" mn = if self.respond_to?(:middle_name) self.middle_name.to_s elsif self.respond_to?(:middlename) self.middlename.to_s else "" end rescue "" "#{ln} #{fn} #{mn}".strip rescue "" end end end
Version data entries
3 entries across 3 versions & 1 rubygems