diff --git a/app/models/host_ansible_role.rb b/app/models/host_ansible_role.rb index f902de79..f784477c 100644 --- a/app/models/host_ansible_role.rb +++ b/app/models/host_ansible_role.rb @@ -2,10 +2,16 @@ # Join model that hosts the connection between hosts and ansible_roles class HostAnsibleRole < ApplicationRecord + audited associated_with: :host + belongs_to_host belongs_to :ansible_role acts_as_list scope: :host validates :ansible_role_id, :presence => true, :uniqueness => { :scope => :host_id } + + def to_label + ansible_role.name + end end