Skip to content

Instantly share code, notes, and snippets.

@zapnap
Created June 4, 2009 23:28
Show Gist options
  • Select an option

  • Save zapnap/123927 to your computer and use it in GitHub Desktop.

Select an option

Save zapnap/123927 to your computer and use it in GitHub Desktop.
# datamapper 0.9.11
# bleh!
irb(main):005:0> Project.all(:fields => [:name, :owner], :unique => true).length
=> 416
Thu, 04 Jun 2009 23:23:10 GMT ~ debug ~ (0.000037) SELECT `name`, `owner` FROM `projects` GROUP BY `name`, `owner` ORDER BY `id`
irb(main):006:0> Project.count(:fields => [:name, :owner], :unique => true)
=> 911
Thu, 04 Jun 2009 23:23:03 GMT ~ debug ~ (0.000037) SELECT COUNT(*) FROM `projects`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment