Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Revert batch upserting

Zach Gollwitzer48a07d6158e5
diff --git a/app/models/security/provided.rb b/app/models/security/provided.rb
index 351e3a3f..b342c9e5 100644
--- a/app/models/security/provided.rb
+++ b/app/models/security/provided.rb
@@ -63,9 +63,7 @@ module Security::Provided
is_invalid
end
- valid_prices.each_slice(100) do |batch|
- Security::Price.upsert_all(batch, unique_by: %i[security_id date currency])
- end
+ Security::Price.upsert_all(valid_prices, unique_by: %i[security_id date currency])
end
def find_or_fetch_price(date: Date.current, cache: true)