app/models/katello/pool.rb in katello-3.11.2 vs app/models/katello/pool.rb in katello-3.12.0.rc1
- old
+ new
@@ -69,9 +69,21 @@
def upstream?
subscription.present? && subscription.redhat?
end
+ def import_audit_record(old_host_ids, new_host_ids = subscription_facets.pluck(:host_id))
+ return if old_host_ids.empty? && new_host_ids.empty?
+ pool_id = self.id
+ Audited::Audit.new(
+ :auditable_id => pool_id,
+ :auditable_type => 'Katello::Pool',
+ :action => 'update',
+ :auditable_name => self.name,
+ :audited_changes => {'host_ids' => [old_host_ids, new_host_ids]}
+ ).save!
+ end
+
private
def default_sort
Pool.joins(:subscription).order("subscription.name")
end