mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-31 10:49:09 +01:00
15 lines
401 B
Ruby
15 lines
401 B
Ruby
# frozen_string_literal: true
|
|
|
|
module User::AnswerMethods
|
|
include CursorPaginatable
|
|
|
|
define_cursor_paginator :cursored_answers, :ordered_answers
|
|
|
|
# @return [ActiveRecord::Relation<Answer>] List of a user's answers
|
|
def ordered_answers
|
|
answers
|
|
.order(:created_at)
|
|
.reverse_order
|
|
.includes(comments: %i[user smiles], question: { user: :profile }, smiles: [:user])
|
|
end
|
|
end
|