Class: ProjectOrganization
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ProjectOrganization
- Includes:
- Housekeeping, Shared::IsData
- Defined in:
- app/models/project_organization.rb
Overview
A ProjectOrganization links Organizations to a Project, for example the institutions that curate, host, or fund the data in that Project.
Instance Attribute Summary collapse
-
#organization_id ⇒ Integer
The organization.
-
#project_id ⇒ Integer
The project.
Instance Method Summary collapse
-
#depictions ⇒ Scope
The Depictions of the Organization in this project.
Methods included from Shared::IsData
#errors_excepting, #full_error_messages_excepting, #identical, #is_community?, #is_in_use?, #similar
Methods included from Housekeeping
#has_polymorphic_relationship?
Methods inherited from ApplicationRecord
Instance Attribute Details
#organization_id ⇒ Integer
Returns the organization.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/project_organization.rb', line 12 class ProjectOrganization < ApplicationRecord include Housekeeping include Shared::IsData belongs_to :organization, inverse_of: :project_organizations validates :organization, presence: true validates_uniqueness_of :organization_id, scope: [:project_id] # @return [Scope] # the Depictions of the Organization in this project def depictions Depiction.where( depiction_object: organization, project_id: ) end end |
#project_id ⇒ Integer
Returns the project.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/project_organization.rb', line 12 class ProjectOrganization < ApplicationRecord include Housekeeping include Shared::IsData belongs_to :organization, inverse_of: :project_organizations validates :organization, presence: true validates_uniqueness_of :organization_id, scope: [:project_id] # @return [Scope] # the Depictions of the Organization in this project def depictions Depiction.where( depiction_object: organization, project_id: ) end end |
Instance Method Details
#depictions ⇒ Scope
Returns the Depictions of the Organization in this project.
24 25 26 27 28 29 |
# File 'app/models/project_organization.rb', line 24 def depictions Depiction.where( depiction_object: organization, project_id: ) end |