I am using Audit gem in my Ruby on Rails application. I have auditables like Order, Invoice for my Audits. My orders and Invoice model starts like this:-
class Order < ApplicationRecord
audited
has_associated_audits
Because of has_associated_audits, Audit[i].auditable will give me order/invoice corresponding to ith Audit. Now some of the Orders are deleted afterwards and Audit[i].auditable becomes nil. How do I get only those Audits for which Audit[i].auditable is not nil?