I have 2 tables
belongs_to(:embedding_in, GateReportSubclass, foreign_key: :embedding_id_in) belongs_to(:embedding_out, GateReportSubclass, foreign_key: :embedding_id_out)
has_many(:in_deliveries, GateReportEvent, foreign_key: :embedding_id_in) has_many(:out_deliveries, GateReportEvent, foreign_key: :embedding_id_out)
AI.GateReportSubclass on preloading gives multiple
GateReportEvent such as
GateReportEvent has 2 dates.
I want to query those dates to get the
AI.GateReportSubclass such as if the given date will fulfill the where clause on
GateReportEvent's dates will be the result.
I am struggling with what join should I use to query the
left_at dates or Is it even possible to get an
AI.GateReportSubclass while filtering multiple
AI.GateReportEvents, any help would be great. thanks.