app/models/iro/alert.rb in iron_warbler-2.0.7.29 vs app/models/iro/alert.rb in iron_warbler-2.0.7.30
- old
+ new
@@ -40,10 +40,14 @@
return if !price
if ( alert.direction == alert.class::DIRECTION_ABOVE && price >= alert.strike ) ||
( alert.direction == alert.class::DIRECTION_BELOW && price <= alert.strike )
- Iro::AlertMailer.stock_alert( alert.id.to_s ).deliver_later
+ if Rails.env.production?
+ Iro::AlertMailer.stock_alert( alert.id.to_s ).deliver_later
+ else
+ Iro::AlertMailer.stock_alert( alert.id.to_s ).deliver_now
+ end
alert.update({ status: alert.class::STATUS_INACTIVE })
print '^'
end
rescue => err