Module: ForemanOpenscap::InheritedPolicies

Included in:
HostgroupExtensions
Defined in:
app/models/concerns/foreman_openscap/inherited_policies.rb

Instance Method Summary collapse

Instance Method Details

#find_inherited_policies(policy_attr) ⇒ Object



3
4
5
6
7
8
9
# File 'app/models/concerns/foreman_openscap/inherited_policies.rb', line 3

def find_inherited_policies(policy_attr)
  return [] unless parent

  ancestors.reduce([]) do |policies, hostgroup|
    policies += hostgroup.public_send(policy_attr)
  end.uniq
end