Skip to content

Instantly share code, notes, and snippets.

@Veejay
Created May 1, 2012 20:16
Show Gist options
  • Save Veejay/2571049 to your computer and use it in GitHub Desktop.
Save Veejay/2571049 to your computer and use it in GitHub Desktop.
1.9.3p0 :168 > WorkWeek.totals_for_project_and_date_range(Project.find(4), Date.today, 3.months.from_now(Date.today))
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 ORDER BY client_id ASC, name ASC LIMIT 1 [["id", 4]]
WorkWeek Load (1.2ms) SELECT "work_weeks".* FROM "work_weeks" WHERE "work_weeks"."project_id" = 4 AND "work_weeks"."year" = 2012 AND ("work_weeks"."cweek" BETWEEN 18 AND 31)
=> {18=>84, 19=>84, 20=>84, 21=>84, 22=>84, 23=>4, 24=>0, 25=>0, 26=>0, 27=>0, 28=>0, 29=>0, 30=>0, 31=>0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment