Skip to content

Instantly share code, notes, and snippets.

@stevenheidel
Created October 26, 2010 22:46
Show Gist options
  • Save stevenheidel/648008 to your computer and use it in GitHub Desktop.
Save stevenheidel/648008 to your computer and use it in GitHub Desktop.
Return Number of AR Objects with same start_at property
looked_at = []
count = 0
Object.all.each do |obj|
if looked_at.include?(obj.start_at)
count += 1
else
looked_at << obj.start_at
end
end
return count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment