Created
September 24, 2010 19:44
-
-
Save landlessness/595914 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
| # i started with the following, which i thought would work with no problem: | |
| AddOn.joins(:pricing_plans).joins(:subscriptions) | |
| # returned this error: | |
| # ActiveRecord::ConfigurationError: | |
| # Association named 'subscriptions' was not found; perhaps you misspelled it? | |
| # trying to get at it from the other direction: | |
| PricingPlan.joins(:subscriptions).joins(:person) | |
| # of course this didn't work either | |
| # ActiveRecord::ConfigurationError: Association named 'person' was not found; perhaps you misspelled it? | |
| # here i shoot in the dark hoping something Arel-like would magically happen: | |
| AddOn.joins(:pricing_plans).joins(:subscriptions).on(pricing_plans[id].eq(subscriptions[pricing_plan_id])) | |
| # of course not. (this is embarrassing) | |
| # NameError: undefined local variable or method `pricing_plans' for #<Object:0x1001d52a8> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment