Make sure that #attachments returns attachments with same timestamp in the order they were created (#12310).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10792 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-11-07 18:06:42 +00:00
parent 4ef90b6096
commit 00927f58af
1 changed files with 1 additions and 1 deletions

View File

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