FIX: Show error messages when adding permalinks in the admin UI (#12545)

Also, check for uniqueness of permalinks before attempting to save.
This commit is contained in:
Daniel Waterworth
2021-03-29 13:36:59 -05:00
committed by GitHub
parent c89f97aafe
commit 70970bb791
2 changed files with 8 additions and 2 deletions

View File

@@ -8,6 +8,8 @@ class Permalink < ActiveRecord::Base
before_validation :normalize_url
validates :url, uniqueness: true
class Normalizer
attr_reader :source