Do you feel it, Mr. Krabs?
This commit is contained in:
parent
c107cb19cb
commit
e510a6e8b4
|
@ -29,13 +29,13 @@ class Ajax::ReportController < ApplicationController
|
||||||
when 'User'
|
when 'User'
|
||||||
User.find_by_screen_name params[:id]
|
User.find_by_screen_name params[:id]
|
||||||
when 'Question'
|
when 'Question'
|
||||||
Question
|
Question.find params[:id]
|
||||||
when 'Answer'
|
when 'Answer'
|
||||||
Answer
|
Answer.find params[:id]
|
||||||
when 'Comment'
|
when 'Comment'
|
||||||
Comment
|
Comment.find params[:id]
|
||||||
else
|
else
|
||||||
Answer
|
Answer.find params[:id]
|
||||||
end
|
end
|
||||||
|
|
||||||
if object.nil?
|
if object.nil?
|
||||||
|
@ -43,11 +43,7 @@ class Ajax::ReportController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if obj == 'User'
|
|
||||||
current_user.report object, params[:reason]
|
current_user.report object, params[:reason]
|
||||||
else
|
|
||||||
current_user.report object.find(params[:id]), params[:reason]
|
|
||||||
end
|
|
||||||
|
|
||||||
@status = :okay
|
@status = :okay
|
||||||
@message = I18n.t('messages.report.create.okay', parameter: params[:type])
|
@message = I18n.t('messages.report.create.okay', parameter: params[:type])
|
||||||
|
|
Loading…
Reference in New Issue