From b3716985f011a1a581c13f65d50ad5bac5801356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Mar=C3=ADa=20Mart=C3=ADnez=20G=C3=B3mez?= Date: Fri, 3 May 2019 17:14:14 +0200 Subject: [PATCH] Stop using reload argument in associations Deprecated force reload argument in association readers is deprecated and has been removed in Rails 5.1: https://github.com/rails/rails/commit/09cac8c67af --- app/models/registration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/registration.rb b/app/models/registration.rb index f7c032ea..a071af28 100644 --- a/app/models/registration.rb +++ b/app/models/registration.rb @@ -76,7 +76,7 @@ class Registration < ApplicationRecord end def registration_limit_not_exceed - if conference.registration_limit > 0 && conference.registrations(:reload).count >= conference.registration_limit + if conference.registration_limit > 0 && conference.registrations.count >= conference.registration_limit errors.add(:base, 'Registration limit exceeded') end end