Trying to work with an existing database in rails. The below works just great in MySQL Console:
select title,blog_name from exp_weblog_titles JOIN exp_weblogs ON exp_weblog_titles.weblog_id = exp_weblogs.weblog_id LIMIT 1;
+------------+---------------+
| title | blog_name |
+------------+---------------+
| What We Do | chicago_pages |
+------------+---------------+
1 row in set (0.00 sec)
However in the rails console, this is what I get:
>> @titles = Title.find_by_sql("select title,blog_name from exp_weblog_titles JOIN exp_weblogs ON exp_weblog_titles.weblog_id = exp_weblogs.weblog_id LIMIT 1")
=> [#<Title title: "What We Do">]
I've seen allusions to the fact that for some reason Rails will only display columns from the first table in console mode without a bit of trickery. Can anyone tell me how to access joined attributes?