Class: Decidim::Organization
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Organization
- Defined in:
- app/models/decidim/organization.rb
Overview
Organizations are one of the main models of Decidim. In a single Decidim installation we can find many organizations and each of them can start their own participatory processes.
Constant Summary collapse
- SOCIAL_HANDLERS =
[:twitter, :facebook, :instagram, :youtube, :github].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #available_authorization_handlers ⇒ Object
- #public_participatory_spaces ⇒ Object
- #published_components ⇒ Object
-
#top_scopes ⇒ Object
Returns top level scopes for this organization.
Class Method Details
.log_presenter_class_for(_log) ⇒ Object
34 35 36 |
# File 'app/models/decidim/organization.rb', line 34 def self.log_presenter_class_for(_log) Decidim::AdminLog::OrganizationPresenter end |
Instance Method Details
#available_authorization_handlers ⇒ Object
38 39 40 |
# File 'app/models/decidim/organization.rb', line 38 def & Decidim..map(&:name) end |
#public_participatory_spaces ⇒ Object
49 50 51 52 53 |
# File 'app/models/decidim/organization.rb', line 49 def public_participatory_spaces @public_participatory_spaces ||= Decidim.participatory_space_manifests.flat_map do |manifest| manifest.participatory_spaces.call(self).public_spaces end end |
#published_components ⇒ Object
55 56 57 |
# File 'app/models/decidim/organization.rb', line 55 def published_components @published_components ||= Component.where(participatory_space: public_participatory_spaces).published end |
#top_scopes ⇒ Object
Returns top level scopes for this organization.
Returns an ActiveRecord::Relation.
45 46 47 |
# File 'app/models/decidim/organization.rb', line 45 def top_scopes @top_scopes ||= scopes.top_level end |