Add association User has many CodeHarborLink
- add migration tht associates User with CodeHarborLink - add belongs_to from CodeHarborLink to User - changed CodeHarborLinkController#index to only serve current user's CodeHarborLinks (leoselig/codeocean#2)
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
class CodeHarborLink < ActiveRecord::Base
|
||||
validates :oauth2token, presence: true
|
||||
validates :user_id, presence: true
|
||||
|
||||
belongs_to :user
|
||||
|
||||
def to_s
|
||||
oauth2token
|
||||
|
Reference in New Issue
Block a user