Friday, September 24, 2010

Rails 3 Complex Join Query

I just struggled mightily to have the new Rails 3 query stuff create the SQL I wanted. I figured it out eventually. Here's the story.

I have the following models:I wanted to add a method to Person that would return all the add-ons to which a person subscribed through payment plans:So, I knew I would need this SQL query:I tried things like this, cursing the new query stuff the whole while:They all failed. Finally, I got what I wanted:It turned out to be nice and simple and I can do sweet chaining things like this:Now, I love the new Rails 3 query stuff.

Thursday, September 16, 2010

Heroku Bundler Deployment Issue

When deploying to heroku recently (bundler 1.0.0) I was getting a nasty looking error: after much struggling, I found troubleshooting directions here:
http://github.com/carlhuda/bundler/blob/master/ISSUES.md
I had to do a couple steps. first these:and then I had to edit my Gemfile to stop using any gems that pointed to github: