17 lines
265 B
Ruby
17 lines
265 B
Ruby
class Mailbox
|
|
module Helpers
|
|
def exists
|
|
Mail.where(mailbox: self).count
|
|
end
|
|
|
|
def recents
|
|
Mail.where(mailbox: self, flag_recent: true).count
|
|
end
|
|
|
|
def unseens
|
|
Mail.where(mailbox: self, flag_seen: true).count
|
|
end
|
|
|
|
end
|
|
end
|