diff options
Diffstat (limited to 'app/models/concerns/routable.rb')
-rw-r--r-- | app/models/concerns/routable.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb index 847abdc1b6d..f382b3624ed 100644 --- a/app/models/concerns/routable.rb +++ b/app/models/concerns/routable.rb @@ -41,7 +41,7 @@ module Routable has_one :route, as: :source, autosave: true, dependent: :destroy, inverse_of: :source # rubocop:disable Cop/ActiveRecordDependent has_many :redirect_routes, as: :source, autosave: true, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent - validates :route, presence: true + validates :route, presence: true, unless: -> { is_a?(Namespaces::ProjectNamespace) } scope :with_route, -> { includes(:route) } @@ -185,6 +185,7 @@ module Routable def prepare_route return unless full_path_changed? || full_name_changed? + return if is_a?(Namespaces::ProjectNamespace) route || build_route(source: self) route.path = build_full_path |