Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-14 15:09:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-14 15:09:23 +0300
commit0b194c4854f312e36616fccf7c610cb2b0ec6957 (patch)
treef4c3d8ed1cd799e50b979035506675a1d90ad4a9 /app/models/award_emoji.rb
parentc1e7698dff17b737299127ecf484443e676cdd4f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/award_emoji.rb')
-rw-r--r--app/models/award_emoji.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/app/models/award_emoji.rb b/app/models/award_emoji.rb
index dc37d73df85..c8f6b9aaedb 100644
--- a/app/models/award_emoji.rb
+++ b/app/models/award_emoji.rb
@@ -27,9 +27,6 @@ class AwardEmoji < ApplicationRecord
after_save :expire_cache
after_destroy :expire_cache
- after_save :update_awardable_upvotes_count
- after_destroy :update_awardable_upvotes_count
-
class << self
def votes_for_collection(ids, type)
select('name', 'awardable_id', 'COUNT(*) as count')
@@ -66,15 +63,6 @@ class AwardEmoji < ApplicationRecord
def expire_cache
awardable.try(:bump_updated_at)
awardable.try(:expire_etag_cache)
- end
-
- private
-
- def update_awardable_upvotes_count
- return unless upvote? && awardable.has_attribute?(:upvotes_count)
-
- awardable.update_column(:upvotes_count, awardable.upvotes)
+ awardable.try(:update_upvotes_count) if upvote?
end
end
-
-AwardEmoji.prepend_mod_with('AwardEmoji')