From 154e4f3c1085f0172d9cde6659069e44811cf673 Mon Sep 17 00:00:00 2001 From: Xavier J Date: Fri, 13 Jan 2017 11:19:29 +0100 Subject: [PATCH] Refacto check_invite! after registration for User. --- app/controllers/users/registrations_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 18054d6a9..fbb10dc8a 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -68,7 +68,6 @@ class Users::RegistrationsController < Devise::RegistrationsController private def check_invite! user - Invite.where(email: user.email) - .each { |invite| invite.update user: user } + Invite.where(email: user.email).update_all user_id: user.id end end