Sha256: 87e5b9a5d0787e25a9742b592e6f87e939cc852033848a4137e17a55ab2a57fe

Contents?: true

Size: 649 Bytes

Versions: 2

Compression:

Stored size: 649 Bytes

Contents

module Popolo
  # An alternate or former name.
  class OtherName
    include Mongoid::Document

    embedded_in :nameable, polymorphic: true

    # An alternate or former name.
    field :name, type: String
    # The date on which the name was adopted.
    field :start_date, type: String
    # The date on which the name was abandoned.
    field :end_date, type: String
    # A note, e.g. "Birth name".
    field :note, type: String

    validates_presence_of :name
    validates_format_of :start_date, with: /\A\d{4}(-\d{2}){0,2}\z/, allow_blank: true
    validates_format_of :end_date, with: /\A\d{4}(-\d{2}){0,2}\z/, allow_blank: true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
popolo-0.0.2 app/models/popolo/other_name.rb
popolo-0.0.1 app/models/popolo/other_name.rb