isotope11/xrono — pull request #30 by xn (2014-03-14 15:42:29+00:00)
Title: User refactor

Use idiomatic ruby for User#hours_entered_for_day

REFACTORED User#expected_hours

Decomposed expeted_hours into:
work_days_between_dates(start,finish)
first_scheduled_date_in_future?(date)
never_worked?
first_scheduled_date

The code is negibly less performant but much more expressive. This
can be refactored into a UserWorkload class along with
User#target_hours_offset(date). As a bonus we now have an ability
to add logic for holidays in User#work_days_between_dates

:::

As an aside, I couldn't get the tests to run at all unless I had a database.yml in xrono/config. Also, there were timeout errors in the cukes.