Question : Printing actual sql query

hi,

This will be a easy question. How do I print sql in console from the following code?

...
...
@attending_ip = AttendingIp.find(:all,
                                :conditions => [ "last_name like ? and first_name like ?", "#{last_name}%", "#{first_name}%"  ],
                                :order => " last_name,first_name ")

thx,

Answer : Printing actual sql query

easiest solution is to watch your dev (or w/e environment you are in) log.

e.g.) tail -f log/development.log

when you perform the finds, the sql will show up there.
Random Solutions  
 
programming4us programming4us