I am using Ahoy for tracking in my web app. I find events with this:
@events = Ahoy::Event.where_properties(title: params[:token])
and I want to get all Visits having visit ID that the above relation, @events, has.
I can join the two tables using Visit.joins(:ahoy_events) but
Visit.joins(:@events)
gives an error, as expected. How do I do this?