docbrown/app/controllers/internal/negative_reactions_controller.rb
Jacob Herrington 7d30463464
Increase the number of negative reactions per page (#6840)
After looking at this UI in production, I realized that showing only
five negative reactions per page was way too few! Bumping this up to 25
which I feel is more reasonable.
2020-03-25 14:18:24 -04:00

15 lines
451 B
Ruby

class Internal::NegativeReactionsController < Internal::ApplicationController
layout "internal"
NEGATIVE_REACTION_CATEGORIES = %i[vomit thumbsdown].freeze
def index
@q = Reaction.
includes(:user,
:reactable).
where("category IN (?)", NEGATIVE_REACTION_CATEGORIES).
order("reactions.created_at DESC").
ransack(params[:q])
@negative_reactions = @q.result.page(params[:page] || 1).per(25)
end
end