Sha256: 5c5efb74e1d6c9b0da6941ba43d9020f52067bb3d7e27abd8f6706a50387af8f

Contents?: true

Size: 407 Bytes

Versions: 27

Compression:

Stored size: 407 Bytes

Contents

module Spina
  class AttachmentCollection < ActiveRecord::Base

    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

27 entries across 27 versions & 1 rubygems

Version Path
spina-0.6.17 app/models/spina/attachment_collection.rb
spina-0.6.16 app/models/spina/attachment_collection.rb
spina-0.6.15 app/models/spina/attachment_collection.rb
spina-0.6.14 app/models/spina/attachment_collection.rb
spina-0.6.13 app/models/spina/attachment_collection.rb
spina-0.6.12 app/models/spina/attachment_collection.rb
spina-0.6.11 app/models/spina/attachment_collection.rb