Sha256: 3966a990efd65305e7806ddccf78b5495a61839d260f49edb8f37c3e544be895

Contents?: true

Size: 340 Bytes

Versions: 10

Compression:

Stored size: 340 Bytes

Contents

module Brightcontent
  module Attachable
    extend ActiveSupport::Concern

    included do
      add_brightcontent_column :attachments
      has_many :attachments, as: :attachable, dependent: :destroy, class_name: Brightcontent::Attachment, :inverse_of => :attachable
    end

    def attachment
      attachments.first
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
brightcontent-attachments-2.0.33 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.31 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.30 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.29 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.28 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.27 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.26 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.25 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.24 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.23 lib/brightcontent/attachable.rb