FIX: Correct description for out of love badge (#8615)

The bug mentioned here
https://meta.discourse.org/t/badge-not-triggering/135896/8

Basically, descriptions for 3 badges: "Out of Love", "Higher Love" and
"Crazy in Love" are granted based on on "max_likes_per_day" and the
description should reflect that.
This commit is contained in:
Krzysztof Kotlarek
2019-12-24 08:30:34 +11:00
committed by GitHub
parent 8c2e27790c
commit 9e4fcb1a0a
2 changed files with 7 additions and 7 deletions

View File

@@ -223,7 +223,7 @@ class Badge < ActiveRecord::Base
def long_description
key = "badges.#{i18n_name}.long_description"
I18n.t(key, default: self[:long_description] || '', base_uri: Discourse.base_uri)
I18n.t(key, default: self[:long_description] || '', base_uri: Discourse.base_uri, max_likes_per_day: SiteSetting.max_likes_per_day)
end
def long_description=(val)
@@ -233,7 +233,7 @@ class Badge < ActiveRecord::Base
def description
key = "badges.#{i18n_name}.description"
I18n.t(key, default: self[:description] || '', base_uri: Discourse.base_uri)
I18n.t(key, default: self[:description] || '', base_uri: Discourse.base_uri, max_likes_per_day: SiteSetting.max_likes_per_day)
end
def description=(val)