Created
May 29, 2020 15:06
-
-
Save bbtdev/72e2601a104123a962c9e96c842c712f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Ordering::Item.joins(:category) | |
.where(ordering_categories: {categorizable_type: "Ordering::Special"}) | |
# ^ vezi cum e ordering_categories si nu doar categories, deci fac join la doar categories | |
Ordering::Category | |
joins("RIGHT JOIN ordering_specials ON ordering_specials.id = ordering_categories.id") | |
# join si pun eu fieldul de join | |
.where("ordering_specials.locked = ?", true) | |
.where("ordering_specials.menuable_type = ?", "Restaurant") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment