diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/featured_tag.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/featured_tag.rb b/app/models/featured_tag.rb index 201ce75f5..b16c79ac7 100644 --- a/app/models/featured_tag.rb +++ b/app/models/featured_tag.rb @@ -26,6 +26,8 @@ class FeaturedTag < ApplicationRecord attr_writer :name + LIMIT = 10 + def name tag_id.present? ? tag.name : @name end @@ -50,7 +52,7 @@ class FeaturedTag < ApplicationRecord end def validate_featured_tags_limit - errors.add(:base, I18n.t('featured_tags.errors.limit')) if account.featured_tags.count >= 10 + errors.add(:base, I18n.t('featured_tags.errors.limit')) if account.featured_tags.count >= LIMIT end def validate_tag_name |