Model validations: Validate the nature of the parent for `Group` & `Namespace`
Based on the discussion from !52658 (comment 501222860)
There appears to be a roadblock once I changed the code to
parent.execute_hooks
and specs complain ofundefined method execute_hooks for #<Namespace:0x000055d2f4498fc8>
for some specs. (Failing test, Another failing test)This is because these tests are creating subgroups under
Namespace
(and notGroup
s). AFAIK, namespaces cannot/would not have subgroups under it. So building such a structure in specs appears to be wrong. Shall I fix these specs?Maybe we should also
raise "cannot create a group under a namespace" unless group.parent.group?
ingroup
factory to avoid these cases. WDYT?
Edited by Manoj M J