i'm struggling to make a query that shows the friends of user that have activities in a city. The variable @friends has the friends of the user, and i want to make a join with activities and and places because i want to filter the results by city. A account(user) has many activities and also has many places though activities. I'm having the following error:
SQLite3::SQLException: no such column: accounts.city:
def show
@friends = Account.find(current_account.id).active_friends
@nearbyFriends = @friends.joins(:activities,:places).where(:city => @place.city).group(:account_id)
end