BigW Consortium Gitlab

Commit 8d74966f by Douwe Maan

Merge branch 'blackst0ne-rails5-fix-route-source-can-t-be-blank' into 'master'

Resolve "[Rails5] Fix `Route source can't be blank`" Closes #46228 See merge request gitlab-org/gitlab-ce!18890
parents ab39a655 c3e40ed8
...@@ -4,7 +4,9 @@ module Routable ...@@ -4,7 +4,9 @@ module Routable
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
has_one :route, as: :source, autosave: true, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent # Remove `inverse_of: source` when upgraded to rails 5.2
# See https://github.com/rails/rails/pull/28808
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 has_many :redirect_routes, as: :source, autosave: true, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
validates :route, presence: true validates :route, presence: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment