Fix wrong belongs_to :user

- because of polymorphic user model this didn't work
- changed to :internal_user because that's anyway the only type of user we
  want to impoprt from

(leoselig/codeocean#1)
This commit is contained in:
leo.selig
2016-02-12 10:57:44 +01:00
parent 63502831aa
commit 5a190c0c79

View File

@ -2,7 +2,9 @@ class CodeHarborLink < ActiveRecord::Base
validates :oauth2token, presence: true
validates :user_id, presence: true
belongs_to :user
belongs_to :internal_user, foreign_key: :user_id
alias_method :user, :internal_user
alias_method :user=, :internal_user=
def to_s
oauth2token