Take a look at ActiveRecord's #find_by_sql or #execute methods.
Michael Glaesemann grzm seespotcode net