From 00927f58af92410b52e1cb0f79198807d3888cfe Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 7 Nov 2012 18:06:42 +0000 Subject: [PATCH] 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 --- lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb index acddf5fa9..626023b1b 100644 --- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb +++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb @@ -30,7 +30,7 @@ module Redmine attachable_options[:delete_permission] = options.delete(:delete_permission) || "edit_#{self.name.pluralize.underscore}".to_sym 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) send :include, Redmine::Acts::Attachable::InstanceMethods before_save :attach_saved_attachments