ActiveRecord question


#1

Hi all, I’m a newbie.

When I test some models in the console, how can I find the generated
sql at background?

Also, one of my table “quotes” has compound primary key “date” and
“ticker”, how can I declare that as the foreign key of another table
“portfolios”? What’s the convention here?

Thanks

Sky


#2

The test log output is in /log/test.log

For the compound key, sorry, not sure.

  • jason

#3

Thanks, but there’s nothing in test.log, only development.log repeating
what
I’ve seen in the console. I got “42000You have an error in your SQL
syntax”
error message on Mysql5 when using join table, so I want to see what
exactly
the SQL is.