docbrown/app/controllers/internal/privileged_reactions_controller.rb
Michael Kohl a4dadfb728
Standardize ActiveRecord order clauses (#9395)
* Change simple order clauses

* Change nested order clauses
2020-07-20 10:00:51 -04:00

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