Sha256: 707f114bbee7eba4e1e58b87fca26b71ac911dfd3bb251d63ce5cb7b22f10dbd

Contents?: true

Size: 1.19 KB

Versions: 31

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

module Decidim
  class ParticipatoryProcessGroup < ApplicationRecord
    include Decidim::Resourceable
    include Decidim::Traceable
    include Decidim::HasUploadValidations
    include Decidim::TranslatableResource

    translatable_fields :title, :description, :developer_group, :local_area, :meta_scope, :participatory_scope,
                        :participatory_structure, :target

    has_many :participatory_processes,
             foreign_key: "decidim_participatory_process_group_id",
             class_name: "Decidim::ParticipatoryProcess",
             inverse_of: :participatory_process_group,
             dependent: :nullify

    belongs_to :organization,
               foreign_key: "decidim_organization_id",
               class_name: "Decidim::Organization"

    has_one_attached :hero_image
    validates_upload :hero_image, uploader: Decidim::HeroImageUploader

    # Scope to return only the promoted groups.
    #
    # Returns an ActiveRecord::Relation.
    def self.promoted
      where(promoted: true)
    end

    def self.log_presenter_class_for(_log)
      Decidim::ParticipatoryProcesses::AdminLog::ParticipatoryProcessGroupPresenter
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-participatory_processes-0.27.9 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.8 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.7 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.6 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.26.10 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.26.9 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.5 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.26.8 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.4 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.3 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.26.7 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.26.5 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.2 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.1 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.26.4 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.0 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.26.3 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.0.rc2 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.27.0.rc1 app/models/decidim/participatory_process_group.rb
decidim-participatory_processes-0.26.2 app/models/decidim/participatory_process_group.rb