module OvirtRefresherSpecCommon
  extend ActiveSupport::Concern

  def serialize_inventory(models = [])
    skip_attributes = %w(updated_on last_refresh_date updated_at last_updated finish_time)
    inventory = {}
    models.each do |model|
      inventory[model.name] = model.all.collect do |rec|
        rec.attributes.except(*skip_attributes)
      end.sort { |rec| rec["id"] }
    end
    inventory
  end
end

module OvirtRefresherSpecCommon
  extend ActiveSupport::Concern

  def serialize_inventory(models = [])
    skip_attributes = %w(updated_on last_refresh_date updated_at last_updated finish_time)
    inventory = {}
    models.each do |model|
      inventory[model.name] = model.all.collect do |rec|
        rec.attributes.except(*skip_attributes)
      end
    end
    inventory
  end
end

--- 
+++ 
@@ -7,7 +7,7 @@
     models.each do |model|
       inventory[model.name] = model.all.collect do |rec|
         rec.attributes.except(*skip_attributes)
-      end
+      end.sort { |rec| rec["id"] }
     end
     inventory
   end
Sort records by ID when doing full table compares
