Merge branch 'dev_trustie' into dev_devops

This commit is contained in:
Jasder 2020-08-29 12:07:37 +08:00
commit 003db1405d
3 changed files with 5 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class Oauth::EducoderController < Oauth::BaseController
user = mail_user
end
if user.is_a?(User)
if user.is_a?(User) && !user.is_a?(AnonymousUser)
OpenUsers::Educoder.create!(user: user, uid: uid)
successful_authentication(user)

View File

@ -1,4 +1,6 @@
class ForkUser < ApplicationRecord
belongs_to :project
belongs_to :project
belongs_to :user
belongs_to :fork_project, class_name: 'ForkUser', foreign_key: :fork_project_id
end

View File

@ -18,6 +18,7 @@ class Project < ApplicationRecord
has_many :project_trends, dependent: :destroy
has_many :watchers, as: :watchable, dependent: :destroy
has_many :fork_users, dependent: :destroy
has_many :forked_users, class_name: 'ForkUser', foreign_key: :fork_project_id, dependent: :destroy
# has_many :commits, dependent: :destroy
has_one :project_score, dependent: :destroy