If you do Thing.find_by_sql(blah).count then it gives you the results of Thing.all.count instead. Example script demonstrating this attached.
Created by DRMacIver - 2010-09-21 11:01:15 UTC
Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1416
该提问来源于开源项目:datamapper/dm-core