Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created December 1, 2011 00:38
Show Gist options
  • Select an option

  • Save typeoneerror/1412290 to your computer and use it in GitHub Desktop.

Select an option

Save typeoneerror/1412290 to your computer and use it in GitHub Desktop.
class Result < ActiveRecord::Base
class << self
def past_week_span(date = nil)
date ||= Date.today
(date.beginning_of_week...date.beginning_of_week + 7).collect do |date|
date.day
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment