1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
class LicenseStatus::Expired def filter(licenses) licenses.where('expired_at < ?', DateTime.now) end def matches?(name) to_s == name end def best_represents?(license) license.expired_at < DateTime.now end def to_s 'expired' end end