Shift validations in Integrations::Base::Integration to models
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !170439 (merged) should be addressed:
-
@.luke started a discussion: Thought
Once we've moved instance integrations out of the
integrationstable, it would be worth moving some of these validations out of the shared module and into the classes soIntegrationhas different validations fromIntegrations::Instance::Integration.For example,
Integrations::Instance::Integrationcould validate thatinstanceis alwaystrue, andproject_idandgroup_idare alwaysnil.Integrationcould validate thatinstanceis alwaysfalseand thatproject_idorgroup_idare present, and so on.
There would be other things we can do too, like:
- Remove
Integrations::Base::Integration#instance_level?and add a methodIntegration#instance_level?which returnsfalseinIntegration. - Move
Integrations::Base::Integration#parenttoIntegrationand add a methodIntegrations::Instance::Integration#parentwhich returnsnil.