If you're using ActiveRecord 3+, you can to .to_sql at the end of any query scope to see the generated SQL.
Also, look at the code in acts_as_geocodable for suggestions.
-Daniel
--
Daniel Morrison
[i] Collective Idea
http://collectiveidea.com
http://ideafoundry.info
25 West 8th Street, Suite 200
Holland, MI 49423
616-990-0155
dan...@collectiveidea.com