Sha256: 9ba94c8e1d7e3ce9adaddc65442cd223af10b49be1e941bfe0a2554ed7653b75
Contents?: true
Size: 582 Bytes
Versions: 8
Compression:
Stored size: 582 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, foreign_key: "attachment_collection_id", class_name: "Decidim::Attachment", dependent: :nullify default_scope { order(arel_table[:weight].asc) } def unused? attachments.empty? end end end
Version data entries
8 entries across 8 versions & 1 rubygems