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-1.4.5 app/models/egov_utils/natural_person.rb
egov_utils-1.4.4 app/models/egov_utils/natural_person.rb
egov_utils-1.4.3 app/models/egov_utils/natural_person.rb
egov_utils-1.4.2 app/models/egov_utils/natural_person.rb
egov_utils-1.4.1 app/models/egov_utils/natural_person.rb
egov_utils-1.4.0 app/models/egov_utils/natural_person.rb
egov_utils-1.3.0 app/models/egov_utils/natural_person.rb
egov_utils-1.2.4 app/models/egov_utils/natural_person.rb
egov_utils-1.2.3 app/models/egov_utils/natural_person.rb
egov_utils-1.2.2 app/models/egov_utils/natural_person.rb
egov_utils-1.2.1 app/models/egov_utils/natural_person.rb
egov_utils-1.2.0 app/models/egov_utils/natural_person.rb
egov_utils-1.1.1 app/models/egov_utils/natural_person.rb
egov_utils-1.1.0 app/models/egov_utils/natural_person.rb
egov_utils-1.0.3 app/models/egov_utils/natural_person.rb
egov_utils-1.0.2 app/models/egov_utils/natural_person.rb
egov_utils-1.0.1 app/models/egov_utils/natural_person.rb
egov_utils-1.0.0 app/models/egov_utils/natural_person.rb
egov_utils-0.7.5 app/models/egov_utils/natural_person.rb
egov_utils-0.7.4 app/models/egov_utils/natural_person.rb