diff --git a/app/models/post_alert_observer.rb b/app/models/post_alert_observer.rb index 2fb9164546e..08112cb58cf 100644 --- a/app/models/post_alert_observer.rb +++ b/app/models/post_alert_observer.rb @@ -101,7 +101,7 @@ class PostAlertObserver < ActiveRecord::Observer result = [] post.raw.scan(/\[quote=\"([^,]+),.+\"\]/).uniq.each do |m| username = m.first.strip.downcase - user = User.where("(LOWER(username_lower) = :username or LOWER(name) = :username) and id != :id", username: username, id: post.user_id).first + user = User.where("username_lower = :username and id != :id", username: username, id: post.user_id).first result << user if user.present? end result diff --git a/spec/models/post_alert_observer_spec.rb b/spec/models/post_alert_observer_spec.rb index 7b6ad2cf35c..0daed2202c3 100644 --- a/spec/models/post_alert_observer_spec.rb +++ b/spec/models/post_alert_observer_spec.rb @@ -37,11 +37,6 @@ describe PostAlertObserver do context 'quotes' do - it 'notifies a user by display username' do - lambda { - Fabricate(:post, raw: '[quote="Evil Trout, post:1"]whatup[/quote]') - }.should change(evil_trout.notifications, :count).by(1) - end it 'notifies a user by username' do lambda {