diff --git a/app/models/communication/website/page/with_path.rb b/app/models/communication/website/page/with_path.rb index 7c4bab76c33dd0b751b82054c4db085d4d91ea61..1cafe5dba6fa1a229753623df8065da2b1b5c6ef 100644 --- a/app/models/communication/website/page/with_path.rb +++ b/app/models/communication/website/page/with_path.rb @@ -75,13 +75,7 @@ module Communication::Website::Page::WithPath end def slug_must_have_proper_format - # TODO method equivalent of: - # validates :slug, - # format: { - # with: /\A[a-z0-9\-]+\z/, - # message: I18n.t('slug_error') - # }, - # unless: :kind_home? + errors.add(:slug, I18n.t('slug_error')) unless /\A[a-z0-9\-]+\z/.match?(slug) end end