Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Commit bf69597

Browse files
authored
Remove missing prices issue (#1390)
1 parent 7d8028b commit bf69597

File tree

8 files changed

+11
-114
lines changed

8 files changed

+11
-114
lines changed

app/models/account/holding/syncer.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ def build_holdings_for_date(date)
6868

6969
price = get_cached_price(ticker, date) || trade_price
7070

71-
account.observe_missing_price(ticker:, date:) unless price
72-
7371
account.holdings.build \
7472
date: date,
7573
security_id: holding[:security_id],

app/models/concerns/issuable.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ def observe_missing_exchange_rate_provider
3333
)
3434
end
3535

36-
def observe_missing_price(ticker:, date:)
37-
issue = issues.find_or_create_by(type: Issue::PricesMissing.name, resolved_at: nil)
38-
issue.append_missing_price(ticker, date)
39-
issue.save!
40-
end
41-
4236
def highest_priority_issue
4337
issues.active.ordered.first
4438
end

app/models/issue/prices_missing.rb

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class RemovePricesMissingIssue < ActiveRecord::Migration[7.2]
2+
def up
3+
execute "DELETE FROM issues WHERE type = 'Issue::PricesMissing'"
4+
end
5+
6+
def down
7+
# Cannot restore deleted issues since we don't have the original data
8+
end
9+
end

db/schema.rb

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/models/account/holding/syncer_test.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ class Account::Holding::SyncerTest < ActiveSupport::TestCase
8585
.once
8686
.returns(fetched_prices)
8787

88-
@account.expects(:observe_missing_price).with(ticker: "AMZN", date: Date.current).once
89-
9088
run_sync_for(@account)
9189

9290
assert_holdings(expected)

test/models/account_test.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,4 @@ class AccountTest < ActiveSupport::TestCase
8989
assert_equal 10, account.holding_qty(security, date: 1.day.ago.to_date)
9090
assert_equal 0, account.holding_qty(security, date: 2.days.ago.to_date)
9191
end
92-
93-
test "can observe missing price" do
94-
account = accounts(:investment)
95-
96-
assert_difference -> { account.issues.count } do
97-
account.observe_missing_price(ticker: "AAPL", date: Date.current)
98-
end
99-
end
10092
end

test/models/issue/prices_missing_test.rb

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)