Sha256: a2b3c020a56d57b842633582c77a13a0adeb5cd2227e3ffff872d0c465551a71

Contents?: true

Size: 406 Bytes

Versions: 4

Compression:

Stored size: 406 Bytes

Contents

module Spina
  class AttachmentCollection < ApplicationRecord

    has_one :page_part, as: :page_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 attachment_tokens=(ids)
      self.attachment_ids = ids.split(",")
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spina-0.12.0 app/models/spina/attachment_collection.rb
spina-0.11.1 app/models/spina/attachment_collection.rb
spina-0.11.0 app/models/spina/attachment_collection.rb
spina-0.10.0 app/models/spina/attachment_collection.rb