Class: Types::OverridenAnsibleVariable

Inherits:
AnsibleVariable show all
Defined in:
app/graphql/types/overriden_ansible_variable.rb

Instance Method Summary collapse

Methods inherited from AnsibleVariable

#ansible_role_name

Instance Method Details

#lookup_values(match: nil) ⇒ Object



20
21
22
23
24
25
26
27
# File 'app/graphql/types/overriden_ansible_variable.rb', line 20

def lookup_values(match: nil)
  return CollectionLoader.for(object.ansible_variable.class, :lookup_values).load(object.ansible_variable) unless match

  scope = lambda do |sc|
    sc.where(:match => match)
  end
  CollectionLoader.for(object.ansible_variable.class, :lookup_values, scope).load(object.ansible_variable)
end

#metaObject



13
14
15
16
17
18
# File 'app/graphql/types/overriden_ansible_variable.rb', line 13

def meta
  {
    :can_edit => ::User.current.can?(object.ansible_variable.permission_name(:edit), object.ansible_variable),
    :can_destroy => ::User.current.can?(object.ansible_variable.permission_name(:destroy), object.ansible_variable)
  }
end