Hide RfCs with keyword #loesung

This commit is contained in:
Sebastian Serth
2020-11-17 00:46:57 +01:00
parent 2f15a322ae
commit 6f3300c66a
2 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ class RequestForCommentsController < ApplicationController
.with_last_activity
.ransack(params[:q])
@request_for_comments = @search.result
.where("question NOT LIKE '%#loesung%'")
.order('created_at DESC')
.paginate(page: params[:page], total_entries: @search.result.length)
authorize!

View File

@ -8,7 +8,7 @@ class RequestForCommentPolicy < ApplicationPolicy
end
def show?
everyone
admin? || teacher_in_study_group? || author? || everyone && @record.question.exclude?('#loesung')
end
def destroy?