From 021f6f03f84f6aaee669f47af35d09a54b1c8b4b Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 12 Apr 2017 15:52:27 +0200 Subject: [PATCH] Fixed bug: In some (test-)cases Taskbar items order is mixed up. --- app/models/taskbar.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/taskbar.rb b/app/models/taskbar.rb index 4b7e123a5..f4614a15c 100644 --- a/app/models/taskbar.rb +++ b/app/models/taskbar.rb @@ -59,7 +59,7 @@ class Taskbar < ApplicationModel self.preferences = {} end preferences[:tasks] = [] - Taskbar.where(key: key).order(:created_at).each { |taskbar| + Taskbar.where(key: key).order(:created_at, :id).each { |taskbar| if taskbar.id == id local_changed = state_changed? local_last_contact = last_contact @@ -86,7 +86,7 @@ class Taskbar < ApplicationModel end # update other taskbars - Taskbar.where(key: key).order(:created_at).each { |taskbar| + Taskbar.where(key: key).order(:created_at, :id).each { |taskbar| next if taskbar.id == id taskbar.preferences = preferences taskbar.local_update = true