You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT DISTINCT "users".* FROM "users"
LEFT OUTER JOIN "sessions_user_surveys" ON "sessions_user_surveys"."user_id" = "users"."id"
LEFT OUTER JOIN "sessions_sessions" ON "sessions_sessions"."id" = "sessions_user_surveys"."session_id"
LEFT OUTER JOIN "sessions_user_surveys" "surveys_users" ON "surveys_users"."user_id" = "users"."id"
WHERE ("sessions_sessions"."id" IN (3) AND "surveys_users"."state" IN ('filling'))
Rails 7 SQL:
SELECT DISTINCT "users".* FROM "users"
LEFT OUTER JOIN "sessions_user_surveys" ON "sessions_user_surveys"."user_id" = "users"."id"
LEFT OUTER JOIN "sessions_sessions" ON "sessions_sessions"."id" = "sessions_user_surveys"."session_id"
WHERE ("sessions_sessions"."id" IN (3) AND "surveys_users"."state" IN ('filling'))
I have User model with the following associations:
The code below works fine in rails 5.2, but in rails 7 ransack tries to use aliases without actually creating them in left joins.
Rails 5.2 SQL:
Rails 7 SQL:
I tried to downgrade ransack to the one used in rails 5 (2.5.0), but the output remained the same.
Gemflie.lock v 5.2
Gemflie.lock v 7.0
The text was updated successfully, but these errors were encountered: