summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-14 20:38:57 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-14 20:38:57 +0300
commit13af7de9411ef20fcab00f7c5d7cdc6b90dbd4b7 (patch)
tree31876b6aa09c0c838ec3838aa0072293b3a0f0e6 /app/models/user.rb
parent8210d813812571b479d630ff61410347f8ebeb5b (diff)
downloadgitlab-ce-13af7de9411ef20fcab00f7c5d7cdc6b90dbd4b7.tar.gz
Fix migration and association for new members table
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index ef006e07b64..d5a6b468fcd 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -85,8 +85,8 @@ class User < ActiveRecord::Base
has_many :project_members, source: 'ProjectMember'
has_many :group_members, source: 'GroupMember'
has_many :groups, through: :group_members
- has_many :owned_groups, -> { where group_members: { access_level: Gitlab::Access::OWNER } }, through: :group_members, source: :group
- has_many :masters_groups, -> { where group_members: { access_level: Gitlab::Access::MASTER } }, through: :group_members, source: :group
+ has_many :owned_groups, -> { where members: { access_level: Gitlab::Access::OWNER } }, through: :group_members, source: :group
+ has_many :masters_groups, -> { where members: { access_level: Gitlab::Access::MASTER } }, through: :group_members, source: :group
# Projects
has_many :groups_projects, through: :groups, source: :projects
@@ -97,7 +97,7 @@ class User < ActiveRecord::Base
has_many :starred_projects, through: :users_star_projects, source: :project
has_many :snippets, dependent: :destroy, foreign_key: :author_id, class_name: "Snippet"
- has_many :project_members, dependent: :destroy
+ has_many :project_members, dependent: :destroy, class_name: 'ProjectMember'
has_many :issues, dependent: :destroy, foreign_key: :author_id
has_many :notes, dependent: :destroy, foreign_key: :author_id
has_many :merge_requests, dependent: :destroy, foreign_key: :author_id