:include vs. :joins
|
|
Hey Ryan, Thanks, |
Ryan Bates
25 posts
|
Hi James, That’s a good question. The :select option generally does not work with :include, so you’ll have to use :joins. However :joins does not instantiate the associated models so I doubt that will do what you want either. AFAIK, this is a limitation of Active Record. There doesn’t seem to be an easy solution to this, so I’d say the slight speed boost from :select isn’t worth the trouble here. That said, there may be some way to do this that I’m not seeing, or it may be added in the future. You may want to ask the question on the Rails mailing list. |
2 posts, 2 voices
