Skip to content

Instantly share code, notes, and snippets.

@Veejay
Created April 29, 2012 19:58
Show Gist options
  • Save Veejay/2552959 to your computer and use it in GitHub Desktop.
Save Veejay/2552959 to your computer and use it in GitHub Desktop.
def work_weeks_for_date_range(date_range)
{}.tap do |result|
date_range.each do |date|
result.store(date, WorkWeek.where(user_id: id, cweek: date.cweek, year: date.year, project_id: projects.for_company(current_company_id).map(&:id)))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment