app/models/device.rb
# The number of days the device's most overdue loan is overdue.
# If there are no overdue loans, returns 0.
#
# @return [Integer]
The number of days the device's most overdue loan is overdue.
If there are no overdue loans, returns 0.
The number of days the device ' s most overdue loan is overdue . If there are no overdue loans returns 0 .
def days_overdue
    return 0 unless overdue?
    loans_by_creation_asc.overdue.first.days_overdue
  end
def days_overdue return 0 unless overdue? loans_by_creation_asc . overdue . first . days_overdue end
The number of days the device's most overdue loan is overdue.
The number of days the device ' s most overdue loan is overdue .
None
Integer