lib/brightcontent/attachable.rb in brightcontent-attachments-2.0.22 vs lib/brightcontent/attachable.rb in brightcontent-attachments-2.0.23
- old
+ new
@@ -2,10 +2,10 @@
module Attachable
extend ActiveSupport::Concern
included do
add_brightcontent_column :attachments
- has_many :attachments, as: :attachable, dependent: :destroy, class_name: Brightcontent::Attachment
+ has_many :attachments, as: :attachable, dependent: :destroy, class_name: Brightcontent::Attachment, :inverse_of => :attachable
end
def attachment
attachments.first
end