Skip to content

Instantly share code, notes, and snippets.

@ashaegupta
Last active August 29, 2015 14:09
Show Gist options
  • Save ashaegupta/3417edaf4e72d255affb to your computer and use it in GitHub Desktop.
Save ashaegupta/3417edaf4e72d255affb to your computer and use it in GitHub Desktop.
query = "Level"
levels = Project.where("title LIKE ?", "#{query}%")
start_date = Time.now.beginning_of_week - 1.day
end_date = start_date + 7.days
Project.where(updated_at: range, published: true)
_.count
levels.where(updated_at: range, published: true)
_.count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment