Sha256: 5389d752b0433844c161eae8a8a84a41d6c9501a644ab5b5d4712d2f08ad1a48

Contents?: true

Size: 493 Bytes

Versions: 10

Compression:

Stored size: 493 Bytes

Contents

module Spina
  class AttachmentCollection < ApplicationRecord

    has_one :page_part, as: :page_partable
    has_many :structure_parts, as: :structure_partable
    has_and_belongs_to_many :attachments, join_table: 'spina_attachment_collections_attachments'

    attr_reader :attachment_tokens
    accepts_nested_attributes_for :attachments, allow_destroy: true

    def content
      self
    end

    def attachment_tokens=(ids)
      self.attachment_ids = ids.split(",")
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spina-1.2.0 app/models/spina/attachment_collection.rb
spina-1.1.4 app/models/spina/attachment_collection.rb
spina-1.1.3 app/models/spina/attachment_collection.rb
spina-1.1.2 app/models/spina/attachment_collection.rb
spina-1.1.1 app/models/spina/attachment_collection.rb
spina-1.1.0 app/models/spina/attachment_collection.rb
spina-1.0.3 app/models/spina/attachment_collection.rb
spina-1.0.2 app/models/spina/attachment_collection.rb
spina-1.0.1 app/models/spina/attachment_collection.rb
spina-1.0.0 app/models/spina/attachment_collection.rb