Skip to content

Commit

Permalink
replace .each_with_object with .index_by
Browse files Browse the repository at this point in the history
  • Loading branch information
rubygitflow committed Feb 27, 2024
1 parent c7021a5 commit 1bff05a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/ozon/products_downloader/importing_scheme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Ozon
class ProductsDownloader
module ImportingScheme
def import_payload(items)
list = items.each_with_object({}) { |item, res| res[item[:id].to_s] = item }
list = items.index_by { |elem| elem[:id].to_s }
# 1. making changes to existing products
exists = verify_existing_products(list)
# 2. adding new products
Expand Down

0 comments on commit 1bff05a

Please sign in to comment.