Could you please change this to something which reads better like:

~~~ruby
when 0..6
  ...
else
  raise(ActiveRecordError, ...)
end