BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
project_member.rb
app/models/members/project_member.rb
+1
-2
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