]> source.dussan.org Git - redmine.git/commitdiff
Adds :inverse_of option.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 29 Nov 2014 13:52:29 +0000 (13:52 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 29 Nov 2014 13:52:29 +0000 (13:52 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13666 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb

index e86b83eb36e44d4bd92db2f9de7e1a6b92bc0428..ff1ee23f2835ec635381e8b1739b100c904eba62 100644 (file)
@@ -31,7 +31,7 @@ module Redmine
           attachable_options[:delete_permission] = options.delete(:delete_permission) || "edit_#{self.name.pluralize.underscore}".to_sym
 
           has_many :attachments, lambda {order("#{Attachment.table_name}.created_on ASC, #{Attachment.table_name}.id ASC")},
-                                 options.merge(:as => :container, :dependent => :destroy)
+                                 options.merge(:as => :container, :dependent => :destroy, :inverse_of => :container)
           send :include, Redmine::Acts::Attachable::InstanceMethods
           before_save :attach_saved_attachments
         end