Commit 922eb6d3 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'jej/remove-dependent-destroy-from-protected-refs' into 'master'

Remove 'dependent: :destroy' from ProtectedRef has_many :"#{type}_access_levels"

See merge request !13835
parents ef8eb3f6 bd1be9bb
...@@ -23,7 +23,7 @@ module ProtectedRef ...@@ -23,7 +23,7 @@ module ProtectedRef
# If we don't `protected_branch` or `protected_tag` would be empty and # If we don't `protected_branch` or `protected_tag` would be empty and
# `project` cannot be delegated to it, which in turn would cause validations # `project` cannot be delegated to it, which in turn would cause validations
# to fail. # to fail.
has_many :"#{type}_access_levels", dependent: :destroy, inverse_of: self.model_name.singular # rubocop:disable Cop/ActiveRecordDependent has_many :"#{type}_access_levels", inverse_of: self.model_name.singular # rubocop:disable Cop/ActiveRecordDependent
validates :"#{type}_access_levels", length: { is: 1, message: "are restricted to a single instance per #{self.model_name.human}." } validates :"#{type}_access_levels", length: { is: 1, message: "are restricted to a single instance per #{self.model_name.human}." }
......
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