This reverts commit 7159199402.
This commit is contained in:
parent
7159199402
commit
e081551dc0
2 changed files with 1 additions and 20 deletions
|
|
@ -35,8 +35,7 @@ class Tag < ActsAsTaggableOn::Tag
|
|||
before_save :mark_as_updated
|
||||
|
||||
after_commit :bust_cache
|
||||
after_update_commit :bust_articles_cache
|
||||
|
||||
|
||||
pg_search_scope :search_by_name,
|
||||
against: :name,
|
||||
using: { tsearch: { prefix: true } }
|
||||
|
|
@ -102,13 +101,6 @@ class Tag < ActsAsTaggableOn::Tag
|
|||
Tags::BustCacheWorker.perform_async(name)
|
||||
end
|
||||
|
||||
def bust_articles_cache
|
||||
article_ids = articles.published.order(created_at: :desc).limit(100).ids
|
||||
article_ids.each_slice(10) do |ids|
|
||||
Articles::BustMultipleCachesWorker.perform_async(ids)
|
||||
end
|
||||
end
|
||||
|
||||
def validate_alias_for
|
||||
return if Tag.exists?(name: alias_for)
|
||||
|
||||
|
|
|
|||
|
|
@ -122,17 +122,6 @@ RSpec.describe Tag, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
it "triggers articles cache busting on save" do
|
||||
sidekiq_perform_enqueued_jobs do
|
||||
tag.save
|
||||
end
|
||||
first = create(:article, tags: tag.name, published: true)
|
||||
second = create(:article, tags: tag.name, published: true)
|
||||
sidekiq_assert_enqueued_with(job: Articles::BustMultipleCachesWorker, args: [[second.id, first.id]]) do
|
||||
tag.save
|
||||
end
|
||||
end
|
||||
|
||||
it "finds mod chat channel" do
|
||||
channel = create(:chat_channel)
|
||||
tag.mod_chat_channel_id = channel.id
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue