Sha256: 0e5b70cbc740796a8ed16e3940012a59b365db262dd8299062b4d0a3e2b0feca

Contents?: true

Size: 916 Bytes

Versions: 2

Compression:

Stored size: 916 Bytes

Contents

module Popolo
  # A means of contacting an entity.
  class ContactDetail
    include Mongoid::Document
    include Mongoid::Timestamps

    embedded_in :contactable, polymorphic: true
    # URLs to documents from which the contact detail is derived.
    embeds_many :sources, as: :linkable, class_name: 'Popolo::Link'

    # A human-readable label for the contact detail.
    field :label, type: String
    # A type of medium, e.g. 'fax' or 'email'.
    field :type, type: String
    # A value, e.g. a phone number or email address.
    field :value, type: String
    # A note, e.g. for grouping contact details by physical location.
    field :note, type: String
    # The date from which the contact detail is valid.
    field :valid_from, type: DateString
    # The date from which the contact detail is no longer valid.
    field :valid_until, type: DateString

    validates_presence_of :type, :value
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
popolo-0.1.1 app/models/popolo/contact_detail.rb
popolo-0.1.0 app/models/popolo/contact_detail.rb