Sha256: e44c2dcac87a15cd13adcd6de11ea871576e60cf0594970a191c4ccc3cb9bc71
Contents?: true
Size: 572 Bytes
Versions: 16
Compression:
Stored size: 572 Bytes
Contents
module ForemanAnsible # Relations to make Hostgroup 'have' ansible roles module HostgroupExtensions extend ActiveSupport::Concern included do has_many :hostgroup_ansible_roles, :foreign_key => :hostgroup_id has_many :ansible_roles, :through => :hostgroup_ansible_roles, :dependent => :destroy include ForemanAnsible::HasManyAnsibleRoles def inherited_ansible_roles ancestors.reduce([]) do |roles, hostgroup| roles + hostgroup.ansible_roles end.uniq end end end end
Version data entries
16 entries across 16 versions & 1 rubygems