Sha256: 325b9cdbea648caccab8a193e647b386678099cbd143bfb96b50abfd52b7c52b

Contents?: true

Size: 475 Bytes

Versions: 60

Compression:

Stored size: 475 Bytes

Contents

module EgovUtils
  class NaturalPerson < AbstractPerson

    belongs_to :person, class_name: 'EgovUtils::Person'

    validates :firstname, :lastname, :birth_date, presence: true
    validates :birth_date, uniqueness: { scope: [:firstname, :lastname] }, birthday: true

    def fullname
      firstname.to_s + ' ' + lastname.to_s
    end

    def to_s
      "#{fullname} (#{I18n.t(:text_born_on_at, place: birth_place, date: I18n.l(birth_date.to_date))})"
    end

  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
egov_utils-0.7.3 app/models/egov_utils/natural_person.rb
egov_utils-0.7.2 app/models/egov_utils/natural_person.rb
egov_utils-0.7.1 app/models/egov_utils/natural_person.rb
egov_utils-0.7.0 app/models/egov_utils/natural_person.rb
egov_utils-0.6.5 app/models/egov_utils/natural_person.rb
egov_utils-0.6.4 app/models/egov_utils/natural_person.rb
egov_utils-0.6.3 app/models/egov_utils/natural_person.rb
egov_utils-0.6.2 app/models/egov_utils/natural_person.rb
egov_utils-0.6.1 app/models/egov_utils/natural_person.rb
egov_utils-0.6.0 app/models/egov_utils/natural_person.rb
egov_utils-0.5.2 app/models/egov_utils/natural_person.rb
egov_utils-0.5.1 app/models/egov_utils/natural_person.rb
egov_utils-0.5.0 app/models/egov_utils/natural_person.rb
egov_utils-0.4.18 app/models/egov_utils/natural_person.rb
egov_utils-0.4.17 app/models/egov_utils/natural_person.rb
egov_utils-0.4.16 app/models/egov_utils/natural_person.rb
egov_utils-0.4.15 app/models/egov_utils/natural_person.rb
egov_utils-0.4.14 app/models/egov_utils/natural_person.rb
egov_utils-0.4.13 app/models/egov_utils/natural_person.rb
egov_utils-0.4.10 app/models/egov_utils/natural_person.rb