lib/doggy/cli/pull.rb in doggy-2.0.42 vs lib/doggy/cli/pull.rb in doggy-2.1.0

- old
+ new

@@ -1,6 +1,7 @@ # encoding: utf-8 +# frozen_string_literal: true require 'parallel' module Doggy class CLI::Pull @@ -33,11 +34,11 @@ remote_resources = [Models::Dashboard, Models::Monitor, Models::Screen].map do |klass| klass.find(id) end.compact if local_resources.size != remote_resources.size - normalized_remote_resources = remote_resources.map { |remote_resource| [ remote_resource.class.name, remote_resource.id ] } - normalized_local_resources = local_resources.map { |local_resource| [ local_resource.class.name, local_resource.id ] } + normalized_remote_resources = remote_resources.map { |remote_resource| [remote_resource.class.name, remote_resource.id] } + normalized_local_resources = local_resources.map { |local_resource| [local_resource.class.name, local_resource.id] } normalized_resource_diff = Hash[normalized_remote_resources - normalized_local_resources] # Here we traverse `remote_resources` to find remote resource with matching class name and id. # We cannot subtract `local_resources` from `remote_resources` because those are different kind of objects. remote_resources_to_be_saved = normalized_resource_diff.map do |klass, normalized_resource_id|