docbrown/app/controllers/admin/privileged_reactions_controller.rb
rhymes 3dae3ff797
Upgrade rubocop* packages to the latest version and fix violations (#11972)
* Update erb_lint to track newer Rubocop versions

* Update rubocop-rspec to 2.1

* Fix Rails/WhereEquals and Style/RedundantParentheses

* Upgrade rubocop to 1.1.0

* Enable Rubocop 1.1 cops

* Upgrade rubocop to 1.2.0

* Enable Rubocop 1.2 cops

* Upgrade rubocop to 1.3.0

* Enable Rubocop 1.3 cops

* Enable Rubocop 1.4 cops

* Enable Rubocop 1.5 cops

* Upgrade rubocop to 1.6.x

* Restore previous .reject

* Fork the PR to make sure we don't inject unwanted code accidentally
2020-12-21 18:29:43 +01:00

16 lines
459 B
Ruby

module Admin
class PrivilegedReactionsController < Admin::ApplicationController
layout "admin"
PRIVILEGED_REACTION_CATEGORIES = %i[thumbsup thumbsdown vomit].freeze
def index
@q = Reaction
.includes(:user, :reactable)
.where(category: PRIVILEGED_REACTION_CATEGORIES)
.order(created_at: :desc)
.ransack(params[:q])
@privileged_reactions = @q.result.page(params[:page] || 1).per(25)
end
end
end