Hide RfCs with keyword #loesung
This commit is contained in:
@ -17,6 +17,7 @@ class RequestForCommentsController < ApplicationController
|
|||||||
.with_last_activity
|
.with_last_activity
|
||||||
.ransack(params[:q])
|
.ransack(params[:q])
|
||||||
@request_for_comments = @search.result
|
@request_for_comments = @search.result
|
||||||
|
.where("question NOT LIKE '%#loesung%'")
|
||||||
.order('created_at DESC')
|
.order('created_at DESC')
|
||||||
.paginate(page: params[:page], total_entries: @search.result.length)
|
.paginate(page: params[:page], total_entries: @search.result.length)
|
||||||
authorize!
|
authorize!
|
||||||
|
@ -8,7 +8,7 @@ class RequestForCommentPolicy < ApplicationPolicy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show?
|
def show?
|
||||||
everyone
|
admin? || teacher_in_study_group? || author? || everyone && @record.question.exclude?('#loesung')
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
|
Reference in New Issue
Block a user