Fixed bug: In some (test-)cases Taskbar items order is mixed up.

This commit is contained in:
Thorsten Eckel 2017-04-12 15:52:27 +02:00
parent c3d91a8ce2
commit 021f6f03f8

View file

@ -59,7 +59,7 @@ class Taskbar < ApplicationModel
self.preferences = {} self.preferences = {}
end end
preferences[:tasks] = [] 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 if taskbar.id == id
local_changed = state_changed? local_changed = state_changed?
local_last_contact = last_contact local_last_contact = last_contact
@ -86,7 +86,7 @@ class Taskbar < ApplicationModel
end end
# update other taskbars # 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 next if taskbar.id == id
taskbar.preferences = preferences taskbar.preferences = preferences
taskbar.local_update = true taskbar.local_update = true