remove strict case requirement

This commit is contained in:
pixeldesu 2015-07-17 22:46:05 +02:00
parent 19d6ccd855
commit 36d6cd5816
2 changed files with 3 additions and 3 deletions

View file

@ -72,9 +72,9 @@ class Ajax::InboxController < ApplicationController
def remove_all_author
begin
@target_user = User.find_by_screen_name params[:author]
@target_user = User.where('LOWER(screen_name) = ?', params[:author].downcase).first!
@inbox = current_user.inboxes.joins(:question)
.where(questions: { user_id: @target_user.id, author_is_anonymous: false })
.where(questions: { user_id: @target_user.id, author_is_anonymous: false })
@inbox.each { |i| i.remove }
rescue
@status = :err

View file

@ -9,7 +9,7 @@ class InboxController < ApplicationController
if params[:author].present?
begin
@author = true
@target_user = User.find_by_screen_name params[:author]
@target_user = User.where('LOWER(screen_name) = ?', params[:author].downcase).first!
@inbox_author = current_user.inboxes.joins(:question)
.where(questions: { user_id: @target_user.id, author_is_anonymous: false })
.paginate(page: params[:page])