Hello, in my users model, I have the following:
@users = find(:all, :joins => :instance, :conditions => ['fname LIKE ? or lname LIKE ?', "%#{search}%", "%#{search}%"])
The issue here is that @users only returns data from the user's table, and not the joined instance table. I confirmed this with the SQL query in the logs.
SELECT "users".* FROM "users" INNER JOIN "instances" ON "instances"."id" = "users"."instance_id" WHERE (fname LIKE '%%' or lname LIKE '%%')
How can I make rails SELECT users.* and instance.name ?
Thanks