Extract concern to share hidden content code

This commit is contained in:
Javi Martín
2022-08-08 14:27:58 +02:00
parent 3e50b7ccaf
commit f6fefde91d
7 changed files with 23 additions and 22 deletions

View File

@@ -0,0 +1,11 @@
module Admin::HiddenContent
extend ActiveSupport::Concern
included do
has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index
end
def hidden_content(relation)
relation.only_hidden.send(@current_filter).order(hidden_at: :desc).page(params[:page])
end
end