From cfdb17e24f4818219a500df8c97ea2d1ad24f650 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 8 Nov 2019 15:34:51 +0800 Subject: [PATCH] 1 --- app/controllers/trustie_hacks_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/trustie_hacks_controller.rb b/app/controllers/trustie_hacks_controller.rb index 22a7a2976..0ae56383c 100644 --- a/app/controllers/trustie_hacks_controller.rb +++ b/app/controllers/trustie_hacks_controller.rb @@ -49,10 +49,10 @@ class TrustieHacksController < ApplicationController # 报名入口 def entry - if @hack.hack_users.exists?(user_id: current_user) + if @hack.hack_users.exists?(user_id: current_user.id) render_error('已经报名,请勿重复操作') else - @hack.hack_users.create(user_id: current_user) + @hack.hack_users.create(user_id: current_user.id) render_ok end end