Good morning, I have the following query that does not work for me:
def self.search(profesor) ->pasa como parametro el nombre del profesor
Curso.joins(:user).where("LOWER(users.name) LIKE ?", "%#{profesor}%")
end
I have a course with a user_id attribute (corresponds to the teacher who gives that course)
I have the table user with an id and a name.
I need to ask a question where I bring all those courses where the teacher = user.name from the course model. Any ideas?
Thank you very much!