Commit e1d99b5dbe25a755d0edda59e6b19750073a7dad

Authored by Andrew Kane
1 parent 4fc24381

Fix for infinite loop with Rails 5

Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
lib/groupdate/magic.rb
... ... @@ -224,8 +224,14 @@ module Groupdate
224 224 step = 1.send(field)
225 225 end
226 226  
227   - while (next_step = round_time(series.last + step)) && time_range.cover?(next_step)
  227 + last_step = series.last
  228 + while (next_step = round_time(last_step + step)) && time_range.cover?(next_step)
  229 + if next_step == last_step
  230 + last_step += step
  231 + next
  232 + end
228 233 series << next_step
  234 + last_step = next_step
229 235 end
230 236  
231 237 series
... ...