创建openi记录之后建立起user与openi之间的联系

dev_ec
Alec Zhou 6 years ago
parent fcfda1f9a2
commit 4b7d55cbef

@ -196,6 +196,8 @@ class OauthController < ApplicationController
UserExtensions.create!(user_id: user.id, school_id: School.first.id, identity: 4, gender: 0) UserExtensions.create!(user_id: user.id, school_id: School.first.id, identity: 4, gender: 0)
openi = Openi.create!(user_id: user.id, openi_user_id: openi_user_id, avatar_url: avatar_url, login: login, name: name, email: email) openi = Openi.create!(user_id: user.id, openi_user_id: openi_user_id, avatar_url: avatar_url, login: login, name: name, email: email)
openi.user = user
openi.save!
end end
end end

Loading…
Cancel
Save