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
iv
gitlab-ce
Commits
bfbbb182
Commit
bfbbb182
authored
May 21, 2016
by
Long Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken specs
parent
a263425f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
app/models/members/project_member.rb
app/models/members/project_member.rb
+1
-2
spec/models/members/project_member_spec.rb
spec/models/members/project_member_spec.rb
+0
-1
No files found.
app/models/members/project_member.rb
View file @
bfbbb182
...
...
@@ -3,7 +3,6 @@ class ProjectMember < Member
include
Gitlab
::
ShellAdapter
has_many
:todos
,
through: :user
belongs_to
:project
,
class_name:
'Project'
,
foreign_key:
'source_id'
# Make sure project member points only to project as it source
...
...
@@ -15,7 +14,7 @@ class ProjectMember < Member
scope
:in_projects
,
->
(
projects
)
{
where
(
source_id:
projects
.
pluck
(
:id
))
}
scope
:with_user
,
->
(
user
)
{
where
(
user_id:
user
.
id
)
}
before_destroy
{
todos
.
each
(
&
:destroy
)
}
before_destroy
{
user
.
todos
.
where
(
project_id:
source_id
)
.
each
(
&
:destroy
)
}
class
<<
self
...
...
spec/models/members/project_member_spec.rb
View file @
bfbbb182
...
...
@@ -21,7 +21,6 @@ require 'spec_helper'
describe
ProjectMember
,
models:
true
do
describe
'associations'
do
it
{
is_expected
.
to
have_many
(
:todos
).
through
(
:user
)
}
it
{
is_expected
.
to
belong_to
(
:project
).
class_name
(
'Project'
).
with_foreign_key
(
:source_id
)
}
end
...
...
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