Created
August 21, 2016 14:35
-
-
Save simonqian/d1e1f64de987fe42dd5ab67916c55e59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# payment_orders join orders | |
PaymentOrder.joins(:orders) | |
# payment_orders join orders, payment_orders join gift_packs | |
PaymentOrder.joins(:orders).joins(:gift_pack) | |
# payment_orders join orders, orders join products | |
PaymentOrder.joins(orders: :products) | |
# payment_orders join orders, orders join products, products join product_items | |
PaymentOrder.joins(orders: {products: :product_items}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment