diff --git a/CHANGELOG.md b/CHANGELOG.md index ae5f1f8f8..185ed7fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Optimized notifications system - Fix a bug: when many users with too many unread notifications are connected at the same time, the system kill the application due to memory overflow +- Fix a bug: ReservationReminderWorker crash with undefined method find_by ## v2.4.9 2017 January 4 diff --git a/app/workers/reservation_reminder_worker.rb b/app/workers/reservation_reminder_worker.rb index 68d723dfc..5aff73feb 100644 --- a/app/workers/reservation_reminder_worker.rb +++ b/app/workers/reservation_reminder_worker.rb @@ -16,7 +16,7 @@ class ReservationReminderWorker already_sent = Notification.where( attached_object_type: Reservation.name, attached_object_id: r.id, - notification_type_id: NotificationType.find_by(name: 'notify_member_reservation_reminder') + notification_type_id: NotificationType.find_by_name('notify_member_reservation_reminder') ).count unless already_sent > 0 NotificationCenter.call type: 'notify_member_reservation_reminder',