diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-01-09 20:10:29 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-01-09 20:10:29 +0000 |
commit | 4beae79376923529dfffbea76988a1f22e6f49dd (patch) | |
tree | 2a53a114a66a88495ba901335cbc2bb23ef37709 /app/models | |
parent | c8f53f0e14ca05ca3326e92fb2b71d2d8dfd5daa (diff) | |
parent | de321fbbb55dab5bee8dc344d458230b74570d5d (diff) | |
download | gitlab-ce-4beae79376923529dfffbea76988a1f22e6f49dd.tar.gz |
Merge branch 'remove-project-authorizations-id-column' into 'master'
Remove the project_authorizations.id column
See merge request !8479
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index ec40def6fb1..94a6f3ba799 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -130,7 +130,7 @@ class Project < ActiveRecord::Base has_many :hooks, dependent: :destroy, class_name: 'ProjectHook' has_many :protected_branches, dependent: :destroy - has_many :project_authorizations, dependent: :destroy + has_many :project_authorizations has_many :authorized_users, through: :project_authorizations, source: :user, class_name: 'User' has_many :project_members, -> { where(requested_at: nil) }, dependent: :destroy, as: :source alias_method :members, :project_members diff --git a/app/models/user.rb b/app/models/user.rb index 66a768d54bb..06dd98a3188 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -73,7 +73,7 @@ class User < ActiveRecord::Base has_many :created_projects, foreign_key: :creator_id, class_name: 'Project' has_many :users_star_projects, dependent: :destroy has_many :starred_projects, through: :users_star_projects, source: :project - has_many :project_authorizations, dependent: :destroy + has_many :project_authorizations has_many :authorized_projects, through: :project_authorizations, source: :project has_many :snippets, dependent: :destroy, foreign_key: :author_id @@ -444,7 +444,7 @@ class User < ActiveRecord::Base end def remove_project_authorizations(project_ids) - project_authorizations.where(id: project_ids).delete_all + project_authorizations.where(project_id: project_ids).delete_all end def set_authorized_projects_column |