mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Fix featured tag form not failing on failed tag validations (#10167)
This commit is contained in:
parent
05dfd632c7
commit
5d3e7cee99
1 changed files with 3 additions and 2 deletions
|
@ -18,11 +18,12 @@ class FeaturedTag < ApplicationRecord
|
||||||
|
|
||||||
delegate :name, to: :tag, allow_nil: true
|
delegate :name, to: :tag, allow_nil: true
|
||||||
|
|
||||||
validates :name, presence: true
|
validates_associated :tag, on: :create
|
||||||
|
validates :name, presence: true, on: :create
|
||||||
validate :validate_featured_tags_limit, on: :create
|
validate :validate_featured_tags_limit, on: :create
|
||||||
|
|
||||||
def name=(str)
|
def name=(str)
|
||||||
self.tag = Tag.find_or_initialize_by(name: str.delete('#').mb_chars.downcase.to_s)
|
self.tag = Tag.find_or_initialize_by(name: str.strip.delete('#').mb_chars.downcase.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
def increment(timestamp)
|
def increment(timestamp)
|
||||||
|
|
Loading…
Reference in a new issue