mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-07 21:43:37 +01:00
15 lines
346 B
Ruby
15 lines
346 B
Ruby
# frozen_string_literal: true
|
|
|
|
module User::InboxMethods
|
|
include CursorPaginatable
|
|
|
|
define_cursor_paginator :cursored_inbox, :ordered_inbox
|
|
|
|
# @return [ActiveRecord::Relation<Inbox>] the user's inbox entries
|
|
def ordered_inbox
|
|
inboxes
|
|
.includes(:question, user: :profile)
|
|
.order(:created_at)
|
|
.reverse_order
|
|
end
|
|
end
|