class Pupa::Organization

A group with a common purpose or reason for existence that goes beyond the set of people belonging to it.

Attributes

area_id[RW]
classification[RW]
dissolution_date[RW]
founding_date[RW]
image[RW]
name[RW]
parent[RW]
parent_id[RW]

Public Instance Methods

fingerprint() click to toggle source

@todo Parentless organizations in different jurisdictions can have the

same name. Add a `jurisdiction` property?
Calls superclass method Pupa::Model#fingerprint
# File lib/pupa/models/organization.rb, line 32
def fingerprint
  hash = super.slice(:classification, :parent_id)
  if name
    {
      '$or' => [
        hash.merge('name' => name),
        hash.merge('other_names.name' => name),
      ],
    }
  else
    hash
  end
end
to_s() click to toggle source

Returns the name of the organization.

@return [String] the name of the organization

# File lib/pupa/models/organization.rb, line 26
def to_s
  name
end