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
# this not workPromotion.left_joins(:products_products).where(products_promotions: {product_id: nil})# ActiveRecord::ConfigurationError: Can't join 'Promotion' to association named 'products_products'; perhaps you misspelled it?# this workPromotion.left_joins(:promotions_products).where(products_promotions: {product_id: nil})# Promotion Load (0.6ms) SELECT "promotions".* FROM "promotions" LEFT OUTER JOIN "products_promotions" ON "products_promotions"."promotion_id" = "promotions"."id" WHERE "products_promotions"."product_id" IS NULL LIMIT $1 [["LIMIT", 11]]
In using HABTM, join middle table alias is combined with the associated
models name without sort, while middle table name is combined with those
models name with sort.
Fixesrails#36742.
Steps to reproduce
define
use
Expected behavior
left_joins should support join_table.
Actual behavior
left_joins raise error with join_table name.
System configuration
Rails version:
Rails 5.2.3
Ruby version:
ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin18]
Database version:
postgresql: stable 11.3 (bottled), HEAD
The text was updated successfully, but these errors were encountered: