Sha256: 2aee042fcc5b46b2a83954fba514c3c969c910579ad8faf6cdc190b6a836222e

Contents?: true

Size: 670 Bytes

Versions: 25

Compression:

Stored size: 670 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Categories serve as a taxonomy for attachments to use for while in the
  # context of a participatory space.
  class AttachmentCollection < ApplicationRecord
    include Traceable
    include Decidim::TranslatableResource

    translatable_fields :name, :description
    belongs_to :collection_for, polymorphic: true
    has_many :attachments, class_name: "Decidim::Attachment", dependent: :nullify

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

    def unused?
      attachments.empty?
    end

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

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/models/decidim/attachment_collection.rb
decidim-core-0.28.4 app/models/decidim/attachment_collection.rb
decidim-core-0.27.9 app/models/decidim/attachment_collection.rb
decidim-core-0.29.0 app/models/decidim/attachment_collection.rb
decidim-core-0.28.3 app/models/decidim/attachment_collection.rb
decidim-core-0.27.8 app/models/decidim/attachment_collection.rb
decidim-core-0.29.0.rc4 app/models/decidim/attachment_collection.rb
decidim-core-0.29.0.rc3 app/models/decidim/attachment_collection.rb
decidim-core-0.29.0.rc2 app/models/decidim/attachment_collection.rb
decidim-core-0.29.0.rc1 app/models/decidim/attachment_collection.rb
decidim-core-0.28.2 app/models/decidim/attachment_collection.rb
decidim-core-0.27.7 app/models/decidim/attachment_collection.rb
decidim-core-0.28.1 app/models/decidim/attachment_collection.rb
decidim-core-0.27.6 app/models/decidim/attachment_collection.rb
decidim-core-0.28.0 app/models/decidim/attachment_collection.rb
decidim-core-0.27.5 app/models/decidim/attachment_collection.rb
decidim-core-0.28.0.rc5 app/models/decidim/attachment_collection.rb
decidim-core-0.28.0.rc4 app/models/decidim/attachment_collection.rb
decidim-core-0.27.4 app/models/decidim/attachment_collection.rb
decidim-core-0.27.3 app/models/decidim/attachment_collection.rb