17 lines
509 B
Ruby
17 lines
509 B
Ruby
module Internal
|
|
class PrivilegedReactionsController < Internal::ApplicationController
|
|
layout "internal"
|
|
|
|
PRIVILEGED_REACTION_CATEGORIES = %i[thumbsup thumbsdown vomit].freeze
|
|
|
|
def index
|
|
@q = Reaction
|
|
.includes(:user,
|
|
:reactable)
|
|
.where("category IN (?)", PRIVILEGED_REACTION_CATEGORIES)
|
|
.order("reactions.created_at" => :desc)
|
|
.ransack(params[:q])
|
|
@privileged_reactions = @q.result.page(params[:page] || 1).per(25)
|
|
end
|
|
end
|
|
end
|