Class: Legion::Data::Model::RBAC::RunnerGrant

Inherits:
Object
  • Object
show all
Includes:
ModelHelpers
Defined in:
lib/legion/data/models/rbac/runner_grants.rb

Instance Method Summary collapse

Methods included from ModelHelpers

#actions_list, #active?, #expired?

Instance Method Details

#validateObject



12
13
14
15
16
17
18
# File 'lib/legion/data/models/rbac/runner_grants.rb', line 12

def validate
  super
  errors.add(:team, 'cannot be empty') if team.nil? || team.empty?
  errors.add(:runner_pattern, 'cannot be empty') if runner_pattern.nil? || runner_pattern.empty?
  errors.add(:actions, 'cannot be empty') if actions.nil? || actions.empty?
  errors.add(:granted_by, 'cannot be empty') if granted_by.nil? || granted_by.empty?
end