[deploy] update articles when touched by reactions (#7001)
This commit is contained in:
parent
be63775a46
commit
ef358c0213
2 changed files with 9 additions and 0 deletions
|
|
@ -309,6 +309,7 @@ class Article < ApplicationRecord
|
|||
def touch_by_reaction
|
||||
async_score_calc
|
||||
index!
|
||||
index_to_elasticsearch
|
||||
end
|
||||
|
||||
def comments_blob
|
||||
|
|
|
|||
|
|
@ -851,4 +851,12 @@ RSpec.describe Article, type: :model do
|
|||
expect(feed_article.attributes.keys).to match_array(fields)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#touch_by_reaction" do
|
||||
it "reindexes elasticsearch doc" do
|
||||
sidekiq_assert_enqueued_with(job: Search::IndexToElasticsearchWorker, args: [described_class.to_s, article.search_id]) do
|
||||
article.touch_by_reaction
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue