How to do joins on subqueries in AREL within Rails
You can use join_sources to retrieve the Arel::Nodes::Join from the instance of Arel::SelectManager, and pass that to joins
Using your example:
l_t.joins(counts.join_sources).on(l_t[:id].eq(counts[:user_id]))