I have the following query:
[4] pry(main)> *Teacher*.join_table(:inner, :categories_teachers,
teacher_id: :id, category_id: *Category*.last.id).all
I, [2021-01-07T09:14:16.170823 #9418] INFO -- : (0.000264s) SELECT * FROM
"categories" ORDER BY "id" DESC LIMIT 1
I, [2021-01-07T09:14:16.171589 #9418] INFO -- : (0.000261s) SELECT * FROM
"teachers" INNER JOIN "categories_teachers" ON
(("categories_teachers"."teacher_id" = "teachers"."id") AND
("categories_teachers"."category_id" =
'fcd35ff1-e9bd-4e29-a7a3-3a43e2cb20e4'))
This query returns for me additional columns that not belongs to teachers
table.
I tried to fix this with using select method but it doesn't work:
*Teacher*.join_table(:inner, :categories_teachers, teacher_id: :id,
category_id: *Category*.last.id).select(*'*teachers.**'*).all
How can I fix that?
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/09e4966a-1864-4561-93e0-74311e1f3582n%40googlegroups.com.