Sha256: d72a3b8c254f598af0273c9893e1f21c10934d02910a4e08c6d5bd624743f7fd

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

module Popolo
  # A geographic area whose geometry may change over time.
  class Area
    include Mongoid::Document
    include Mongoid::Timestamps
    include Mongoid::Tree

    store_in Popolo.storage_options_per_class.fetch(:Area, Popolo.storage_options)

    # The geographic area to which the membership is related.
    has_many :memberships, class_name: 'Popolo::Membership'
    # The geographic area to which the organization is related.
    has_many :organizations, class_name: 'Popolo::Organization'
    # The geographic area to which the post is related.
    has_many :posts, class_name: 'Popolo::Post'

    # URLs to documents from which the area is derived.
    embeds_many :sources, as: :linkable, class_name: 'Popolo::Link'

    # A primary name.
    field :name, type: String
    # An issued identifier.
    field :identifier, type: String
    # An area category, e.g. city.
    field :classification, type: String
    # A geometry.
    field :geometry, type: String

    def to_s
      name
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
popolo-0.0.3 app/models/popolo/area.rb