Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
419990eb
Commit
419990eb
authored
Aug 04, 2016
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove scopes.
parent
d0aa98bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
app/models/member.rb
app/models/member.rb
+1
-2
app/models/user.rb
app/models/user.rb
+1
-1
No files found.
app/models/member.rb
View file @
419990eb
...
...
@@ -31,7 +31,6 @@ class Member < ActiveRecord::Base
scope
:non_invite
,
->
{
where
(
invite_token:
nil
)
}
scope
:request
,
->
{
where
.
not
(
requested_at:
nil
)
}
scope
:has_access
,
->
{
where
(
'access_level > 0'
)
}
scope
:still_active
,
->
{
where
(
'expires_at IS NULL OR expires_at > ?'
,
Time
.
current
)
}
scope
:guests
,
->
{
where
(
access_level:
GUEST
)
}
scope
:reporters
,
->
{
where
(
access_level:
REPORTER
)
}
...
...
@@ -55,7 +54,7 @@ class Member < ActiveRecord::Base
class
<<
self
def
access_for_user_ids
(
user_ids
)
where
(
user_id:
user_ids
).
has_access
.
still_active
.
pluck
(
:user_id
,
:access_level
).
to_h
where
(
user_id:
user_ids
).
has_access
.
pluck
(
:user_id
,
:access_level
).
to_h
end
def
find_by_invite_token
(
invite_token
)
...
...
app/models/user.rb
View file @
419990eb
...
...
@@ -66,7 +66,7 @@ class User < ActiveRecord::Base
# Projects
has_many
:groups_projects
,
through: :groups
,
source: :projects
has_many
:personal_projects
,
through: :namespace
,
source: :projects
has_many
:project_members
,
->
{
where
(
requested_at:
nil
)
.
still_active
},
dependent: :destroy
,
class_name:
'ProjectMember'
has_many
:project_members
,
->
{
where
(
requested_at:
nil
)
},
dependent: :destroy
,
class_name:
'ProjectMember'
has_many
:projects
,
through: :project_members
has_many
:created_projects
,
foreign_key: :creator_id
,
class_name:
'Project'
has_many
:users_star_projects
,
dependent: :destroy
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment