Skip to content
Snippets Groups Projects
Commit bfc359ca authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix project filter for MR on dashboard

parent ba937b2b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -27,6 +27,6 @@ module DashboardHelper
items.opened
end
 
items.where(assignee_id: current_user.id).count
items.cared(current_user).count
end
end
Loading
Loading
@@ -24,7 +24,13 @@ class Issue < ActiveRecord::Base
 
acts_as_taggable_on :labels
 
def self.open_for(user)
opened.assigned(user)
class << self
def cared(user)
where('assignee_id = :user', user: user.id)
end
def open_for(user)
opened.assigned(user)
end
end
end
Loading
Loading
@@ -43,12 +43,19 @@ class MergeRequest < ActiveRecord::Base
validates :target_branch, presence: true
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)
where("milestone_id = :milestone_id", milestone_id: milestone)
class << self
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
 
def human_state
Loading
Loading
Loading
Loading
@@ -267,7 +267,7 @@ class User < ActiveRecord::Base
end
 
def cared_merge_requests
MergeRequest.where("author_id = :id or assignee_id = :id", id: self.id)
MergeRequest.cared(self)
end
 
# Remove user from all projects and
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment