From 7635051f49f8f82d4f4b2d04f95f886a2f1f66af Mon Sep 17 00:00:00 2001 From: Prommah Date: Sat, 7 Nov 2015 06:11:26 +0000 Subject: [PATCH] Fixed profle query error when there are zero results --- app/models/match.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/match.rb b/app/models/match.rb index c31806a..4626848 100755 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -193,7 +193,7 @@ class Match < ActiveRecord::Base end def send_notifications - Profile.all(include: :user, conditions: "notify_any_match = 1").find_each do |p| + Profile.includes(:user).where(notify_any_match: 1).find_each do |p| Notifications.match p.user, self if p.user end contester2.team.teamers.active.each do |teamer|