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
bfc359ca
Commit
bfc359ca
authored
Feb 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix project filter for MR on dashboard
parent
ba937b2b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
app/helpers/dashboard_helper.rb
app/helpers/dashboard_helper.rb
+1
-1
app/models/issue.rb
app/models/issue.rb
+8
-2
app/models/merge_request.rb
app/models/merge_request.rb
+12
-5
app/models/user.rb
app/models/user.rb
+1
-1
No files found.
app/helpers/dashboard_helper.rb
View file @
bfc359ca
...
@@ -27,6 +27,6 @@ module DashboardHelper
...
@@ -27,6 +27,6 @@ module DashboardHelper
items
.
opened
items
.
opened
end
end
items
.
where
(
assignee_id:
current_user
.
id
).
count
items
.
cared
(
current_user
).
count
end
end
end
end
app/models/issue.rb
View file @
bfc359ca
...
@@ -24,7 +24,13 @@ class Issue < ActiveRecord::Base
...
@@ -24,7 +24,13 @@ class Issue < ActiveRecord::Base
acts_as_taggable_on
:labels
acts_as_taggable_on
:labels
def
self
.
open_for
(
user
)
class
<<
self
opened
.
assigned
(
user
)
def
cared
(
user
)
where
(
'assignee_id = :user'
,
user:
user
.
id
)
end
def
open_for
(
user
)
opened
.
assigned
(
user
)
end
end
end
end
end
app/models/merge_request.rb
View file @
bfc359ca
...
@@ -43,12 +43,19 @@ class MergeRequest < ActiveRecord::Base
...
@@ -43,12 +43,19 @@ class MergeRequest < ActiveRecord::Base
validates
:target_branch
,
presence:
true
validates
:target_branch
,
presence:
true
validate
:validate_branches
validate
:validate_branches
def
self
.
find_all_by_branch
(
branch_name
)
where
(
"source_branch LIKE :branch OR target_branch LIKE :branch"
,
branch:
branch_name
)
end
def
self
.
find_all_by_milestone
(
milestone
)
class
<<
self
where
(
"milestone_id = :milestone_id"
,
milestone_id:
milestone
)
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
end
def
human_state
def
human_state
...
...
app/models/user.rb
View file @
bfc359ca
...
@@ -267,7 +267,7 @@ class User < ActiveRecord::Base
...
@@ -267,7 +267,7 @@ class User < ActiveRecord::Base
end
end
def
cared_merge_requests
def
cared_merge_requests
MergeRequest
.
where
(
"author_id = :id or assignee_id = :id"
,
id:
self
.
id
)
MergeRequest
.
cared
(
self
)
end
end
# Remove user from all projects and
# Remove user from all projects and
...
...
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