Sha256: 3d3aca5be4008b3489316c7d16a1ce7c1f90c1c7471c0e2ea19baf6a8e1ebf87

Contents?: true

Size: 815 Bytes

Versions: 11

Compression:

Stored size: 815 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # It represents a member of the assembly (president, secretary, ...)
  # Can be linked to an existent user in the platform
  class AssemblyMember < ApplicationRecord
    include Decidim::Traceable
    include Decidim::Loggable

    POSITIONS = %w(president vice_president secretary other).freeze

    belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User", optional: true
    belongs_to :assembly, foreign_key: "decidim_assembly_id", class_name: "Decidim::Assembly"
    alias participatory_space assembly

    default_scope { order(weight: :asc, created_at: :asc) }

    scope :not_ceased, -> { where(ceased_date: nil) }

    def self.log_presenter_class_for(_log)
      Decidim::Assemblies::AdminLog::AssemblyMemberPresenter
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
decidim-assemblies-0.14.4 app/models/decidim/assembly_member.rb
decidim-assemblies-0.14.3 app/models/decidim/assembly_member.rb
decidim-assemblies-0.14.2 app/models/decidim/assembly_member.rb
decidim-assemblies-0.14.1 app/models/decidim/assembly_member.rb
decidim-assemblies-0.13.1 app/models/decidim/assembly_member.rb
decidim-assemblies-0.12.2 app/models/decidim/assembly_member.rb
decidim-assemblies-0.13.0 app/models/decidim/assembly_member.rb
decidim-assemblies-0.12.1 app/models/decidim/assembly_member.rb
decidim-assemblies-0.13.0.pre1 app/models/decidim/assembly_member.rb
decidim-assemblies-0.12.0 app/models/decidim/assembly_member.rb
decidim-assemblies-0.12.0.pre app/models/decidim/assembly_member.rb