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