Sha256: 7125bd98b1765d06379a17cfbafc1127a95215a2b26ae658e7443838b3d8c69a

Contents?: true

Size: 744 Bytes

Versions: 5

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Scope types allows to use different types of scopes in participatory process
  # (municipalities, provinces, states, countries, etc.)
  class ScopeType < ApplicationRecord
    include Decidim::TranslatableResource
    include Traceable

    translatable_fields :name, :plural
    belongs_to :organization,
               foreign_key: "decidim_organization_id",
               class_name: "Decidim::Organization",
               inverse_of: :scope_types

    has_many :scopes, class_name: "Decidim::Scope", inverse_of: :scope_type, dependent: :nullify

    validates :name, presence: true

    def self.log_presenter_class_for(_log)
      Decidim::AdminLog::ScopeTypePresenter
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-core-0.27.2 app/models/decidim/scope_type.rb
decidim-core-0.27.1 app/models/decidim/scope_type.rb
decidim-core-0.27.0 app/models/decidim/scope_type.rb
decidim-core-0.27.0.rc2 app/models/decidim/scope_type.rb
decidim-core-0.27.0.rc1 app/models/decidim/scope_type.rb