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
Kazuhiko Shiozaki
gitlab-ce
Commits
52e0df5c
Commit
52e0df5c
authored
Feb 20, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
class.self methods moved to scopes
parent
e2d94e07
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
19 deletions
+4
-19
app/models/merge_request.rb
app/models/merge_request.rb
+3
-18
app/models/project.rb
app/models/project.rb
+1
-1
No files found.
app/models/merge_request.rb
View file @
52e0df5c
...
...
@@ -81,24 +81,9 @@ class MergeRequest < ActiveRecord::Base
validate
:validate_branches
scope
:merged
,
->
{
with_state
(
:merged
)
}
class
<<
self
def
find_all_by_branch
(
branch_name
)
where
(
"source_branch LIKE :branch OR target_branch LIKE :branch"
,
branch:
branch_name
)
end
def
cared
(
user
)
where
(
'assignee_id = :user OR author_id = :user'
,
user:
user
.
id
)
end
def
find_all_by_branch
(
branch_name
)
where
(
"source_branch LIKE :branch OR target_branch LIKE :branch"
,
branch:
branch_name
)
end
def
find_all_by_milestone
(
milestone
)
where
(
"milestone_id = :milestone_id"
,
milestone_id:
milestone
)
end
end
scope
:by_branch
,
->
(
branch_name
)
{
where
(
"source_branch LIKE :branch OR target_branch LIKE :branch"
,
branch:
branch_name
)
}
scope
:cared
,
->
(
user
)
{
where
(
'assignee_id = :user OR author_id = :user'
,
user:
user
.
id
)
}
scope
:by_milestone
,
->
(
milestone
)
{
where
(
"milestone_id = :milestone_id"
,
milestone_id:
milestone
)
}
# DEPRECATED: Please use human_merge_status_name instead
def
human_merge_status
...
...
app/models/project.rb
View file @
52e0df5c
...
...
@@ -424,7 +424,7 @@ class Project < ActiveRecord::Base
c_ids
=
self
.
repository
.
commits_between
(
oldrev
,
newrev
).
map
(
&
:id
)
# Update code for merge requests
mrs
=
self
.
merge_requests
.
opened
.
find_all_
by_branch
(
branch_name
).
all
mrs
=
self
.
merge_requests
.
opened
.
by_branch
(
branch_name
).
all
mrs
.
each
{
|
merge_request
|
merge_request
.
reload_code
;
merge_request
.
mark_as_unchecked
}
# Close merge requests
...
...
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