Sha256: 8ade85ae2b1da54e27c749eec935f3901cac7287c348004b4f89924b6717845c

Contents?: true

Size: 541 Bytes

Versions: 25

Compression:

Stored size: 541 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 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
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
decidim-core-0.26.10 app/models/decidim/attachment_collection.rb
decidim-core-0.26.9 app/models/decidim/attachment_collection.rb
decidim-core-0.26.8 app/models/decidim/attachment_collection.rb
decidim-core-0.26.7 app/models/decidim/attachment_collection.rb
decidim-core-0.26.5 app/models/decidim/attachment_collection.rb
decidim-core-0.26.4 app/models/decidim/attachment_collection.rb
decidim-core-0.26.3 app/models/decidim/attachment_collection.rb
decidim-core-0.26.2 app/models/decidim/attachment_collection.rb
decidim-core-0.26.1 app/models/decidim/attachment_collection.rb
decidim-core-0.26.0 app/models/decidim/attachment_collection.rb
decidim-core-0.26.0.rc2 app/models/decidim/attachment_collection.rb
decidim-core-0.26.0.rc1 app/models/decidim/attachment_collection.rb
decidim-core-0.25.2 app/models/decidim/attachment_collection.rb
decidim-core-0.25.1 app/models/decidim/attachment_collection.rb
decidim-core-0.25.0 app/models/decidim/attachment_collection.rb
decidim-core-0.25.0.rc4 app/models/decidim/attachment_collection.rb
decidim-core-0.25.0.rc3 app/models/decidim/attachment_collection.rb
decidim-core-0.25.0.rc2 app/models/decidim/attachment_collection.rb
decidim-core-0.25.0.rc1 app/models/decidim/attachment_collection.rb
decidim-core-0.24.3 app/models/decidim/attachment_collection.rb