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:
leo.selig
2016-02-04 12:38:46 +01:00
parent 855abe25a6
commit 68e74a9d85
3 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,5 @@
class AddUserToCodeHarborLink < ActiveRecord::Migration
def change
add_reference :code_harbor_links, :user, index: true, foreign_key: true
end
end