don't notify wranglers if there are none

This commit is contained in:
Brenda Wallace
2019-08-17 14:43:32 +12:00
parent 1cb0096788
commit b2d8818ae1

View File

@@ -139,7 +139,7 @@ class CropsController < ApplicationController
def notify_wranglers
return if current_member.role? :crop_wrangler
Role.crop_wranglers.each do |w|
Role.crop_wranglers&.each do |w|
Notifier.new_crop_request(w, @crop).deliver_now!
end
end