I have two tables: keyword_reports and keywords (with relevant AR models).
keyword_reports has a keyword_id column, which I'm using to join the keywords table like so:
KeywordReport.find(:all, :joins => :keyword, :conditions => {:page_id => 10})
which correctly pulls back records for keyword_reports, but doesn't include the data from the joined keyword table.
I looked at the log to see the generated SQL and it is doing:
SELECT `keyword_reports`.* from...
instead of:
SELECT * from ...
which it needs to do in order for me to get all the data. When I manually edit the SQL to format as desired, sure enough, it grabs all the data. I've tried using :includes and :select to no avail.
How do I prevent the query from limiting results only to the first table?