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
Search gives a SQL error when searching in multiple association attributes linking to same foreign table.
Order (table: orders)
| -> Customer (table: customers)
| -> Seller (table: customers)
I'm not sure if this is a issue with administrate or ActiveRecord. If you cloned my patch then cd spec/example_app/ && bundle exec rails c then run
Order.joins(:customer, :seller).includes(:customer, :seller).first - This works fine Order.joins(:customer, :seller).includes(:seller, :customer).first - This won't
Quick fix for anyone having this issue.
Change the order in which you define the ATTRIBUTE_TYPES or COLLECTION_ATTRIBUTES, this will in turn change the order in query and the issue should disappear.
The text was updated successfully, but these errors were encountered:
This issue might be relating to #1179
Issue
Search gives a SQL error when searching in multiple association attributes linking to same foreign table.
Order (table: orders)
| -> Customer (table: customers)
| -> Seller (table: customers)
How to reproduce
clone this gouthamvel@45bc418 and run test.
Note
I'm not sure if this is a issue with administrate or ActiveRecord. If you cloned my patch then
cd spec/example_app/ && bundle exec rails c
then runOrder.joins(:customer, :seller).includes(:customer, :seller).first
- This works fineOrder.joins(:customer, :seller).includes(:seller, :customer).first
- This won'tQuick fix for anyone having this issue.
Change the order in which you define the ATTRIBUTE_TYPES or COLLECTION_ATTRIBUTES, this will in turn change the order in query and the issue should disappear.
The text was updated successfully, but these errors were encountered: