boulder-food-rescue / food-rescue-robot

A Rails App for Managing "Just in Time" Food Rescue, Developed by/for Boulder Food Rescue in Boulder, CO, USA
49 stars 56 forks source link

Slight clean-up to detailed_hours validation #170

Closed rylanb closed 6 years ago

rylanb commented 6 years ago

Overview

Location.rb had some bugs in it based on a refactor causing generated logs to fail.

Bug fixes in master: https://github.com/boulder-food-rescue/food-rescue-robot/commit/abefee6e3dcc11ba4ac1651bc6b454cc0bea767e

This branch has follow-up cleanup.

I found that you can do this too:

  def day_length(index)
    hours_on_day(index).reverse.reduce(:-)
  end

to fix the initial bug from refactor.

Any thoughts?