Users have one profile, and profiles belong to users.
I’m trying to make a query where searching a user list, and I can search the names which exist in the user’s profiles.
Here is what I have so far:
@user_list = User.where(:company_id => current_user.company.id)
.joins(:profile).where("profile.first_name like ?", "%#{params[:q]}%")
This doesn’t work, but I’m not really sure where to go from here?
profilesand notprofileTogether: