Просмотр исходного кода

Fixed bug: Import detects unchanged associations as changed and unnecessarily updates record.

Thorsten Eckel 7 лет назад
Родитель
Сommit
b0bfe42437
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      lib/import/base_resource.rb

+ 4 - 0
lib/import/base_resource.rb

@@ -156,6 +156,10 @@ module Import
         else
           state[association] = source.send(association)
         end
+
+        # sort arrays to avoid wrong change detection
+        next if !state[association].respond_to?(:sort!)
+        state[association].sort!
       end
       state
     end