Sha256: a56c5ae06b6d11fff0130dd7a88af97e01f277dd8173cab73407491796872604

Contents?: true

Size: 385 Bytes

Versions: 3

Compression:

Stored size: 385 Bytes

Contents

module Brightcontent
  module Attachments
    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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
brightcontent-attachments-2.6.0 lib/brightcontent/attachments/attachable.rb
brightcontent-attachments-2.5.1 lib/brightcontent/attachments/attachable.rb
brightcontent-attachments-2.5.0 lib/brightcontent/attachments/attachable.rb