Sha256: e3ca4e48e8e2a3a9a64d956161aa3cbb99b7bd985c51e712382f15f3d3435a66

Contents?: true

Size: 312 Bytes

Versions: 16

Compression:

Stored size: 312 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
    end

    def attachment
      attachments.first
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
brightcontent-attachments-2.0.22 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.21 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.20 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.19 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.18 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.17 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.16 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.15 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.14 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.13 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.12 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.11 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.10 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.9 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.8 lib/brightcontent/attachable.rb
brightcontent-attachments-2.0.7 lib/brightcontent/attachable.rb