mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 18:01:05 +00:00
Prefer on: :update
in Tag validation declaration (#35297)
This commit is contained in:
parent
b628a98d32
commit
f7259f625f
|
@ -49,8 +49,8 @@ class Tag < ApplicationRecord
|
||||||
|
|
||||||
validates :name, presence: true, format: { with: HASHTAG_NAME_RE }
|
validates :name, presence: true, format: { with: HASHTAG_NAME_RE }
|
||||||
validates :display_name, format: { with: HASHTAG_NAME_RE }
|
validates :display_name, format: { with: HASHTAG_NAME_RE }
|
||||||
validate :validate_name_change, if: -> { !new_record? && name_changed? }
|
validate :validate_name_change, on: :update, if: :name_changed?
|
||||||
validate :validate_display_name_change, if: -> { !new_record? && display_name_changed? }
|
validate :validate_display_name_change, on: :update, if: :display_name_changed?
|
||||||
|
|
||||||
scope :pending_review, -> { unreviewed.where.not(requested_review_at: nil) }
|
scope :pending_review, -> { unreviewed.where.not(requested_review_at: nil) }
|
||||||
scope :usable, -> { where(usable: [true, nil]) }
|
scope :usable, -> { where(usable: [true, nil]) }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user