Sha256: 57084a9a73e51035b829cd063b05be5d5bb48751425cfd31e15ebe2189a2c146

Contents?: true

Size: 538 Bytes

Versions: 50

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class StaticPageTopic < ApplicationRecord
    validates :title, presence: true
    include Decidim::TranslatableResource

    translatable_fields :title, :description

    default_scope { order(arel_table[:weight].asc) }

    belongs_to :organization, class_name: "Decidim::Organization"
    has_many :pages, class_name: "Decidim::StaticPage", foreign_key: "topic_id", dependent: :nullify

    def accessible_pages_for(user)
      pages.accessible_for(organization, user)
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
decidim-core-0.26.8 app/models/decidim/static_page_topic.rb
decidim-core-0.27.4 app/models/decidim/static_page_topic.rb
decidim-core-0.27.3 app/models/decidim/static_page_topic.rb
decidim-core-0.26.7 app/models/decidim/static_page_topic.rb
decidim-core-0.26.5 app/models/decidim/static_page_topic.rb
decidim-core-0.27.2 app/models/decidim/static_page_topic.rb
decidim-core-0.27.1 app/models/decidim/static_page_topic.rb
decidim-core-0.26.4 app/models/decidim/static_page_topic.rb
decidim-core-0.27.0 app/models/decidim/static_page_topic.rb
decidim-core-0.26.3 app/models/decidim/static_page_topic.rb
decidim-core-0.27.0.rc2 app/models/decidim/static_page_topic.rb
decidim-core-0.27.0.rc1 app/models/decidim/static_page_topic.rb
decidim-core-0.26.2 app/models/decidim/static_page_topic.rb
decidim-core-0.26.1 app/models/decidim/static_page_topic.rb
decidim-core-0.26.0 app/models/decidim/static_page_topic.rb
decidim-core-0.26.0.rc2 app/models/decidim/static_page_topic.rb
decidim-core-0.26.0.rc1 app/models/decidim/static_page_topic.rb
decidim-core-0.25.2 app/models/decidim/static_page_topic.rb
decidim-core-0.25.1 app/models/decidim/static_page_topic.rb
decidim-core-0.25.0 app/models/decidim/static_page_topic.rb