summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-04-11 15:17:25 +0000
committerDouwe Maan <douwe@gitlab.com>2017-04-11 15:17:25 +0000
commit3082a1195cc0939e0aa0b48a9f59dd84152ebdad (patch)
treef3b963935c5fe18a2490e04929b49f110837a9dd
parent568052b0c637f99462855c043819aa0dd347ff06 (diff)
parenta1a94e739e73adf0225aa823e476b15e30b9bb30 (diff)
downloadgitlab-ce-3082a1195cc0939e0aa0b48a9f59dd84152ebdad.tar.gz
Merge branch 'rs-remove-open-for-scope' into 'master' test-branch-name
Remove unused scopes See merge request !10609
-rw-r--r--app/models/issue.rb2
-rw-r--r--app/models/merge_request.rb1
-rw-r--r--app/models/user.rb4
-rw-r--r--spec/models/issue_spec.rb9
4 files changed, 0 insertions, 16 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index d8d9db477d2..d39ae3a6c92 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -26,8 +26,6 @@ class Issue < ActiveRecord::Base
validates :project, presence: true
- scope :cared, ->(user) { where(assignee_id: user) }
- scope :open_for, ->(user) { opened.assigned_to(user) }
scope :in_projects, ->(project_ids) { where(project_id: project_ids) }
scope :without_due_date, -> { where(due_date: nil) }
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index b71a9e17a93..d02fa308b9f 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -104,7 +104,6 @@ class MergeRequest < ActiveRecord::Base
scope :by_source_or_target_branch, ->(branch_name) do
where("source_branch = :branch OR target_branch = :branch", branch: branch_name)
end
- scope :cared, ->(user) { where('assignee_id = :user OR author_id = :user', user: user.id) }
scope :by_milestone, ->(milestone) { where(milestone_id: milestone) }
scope :of_projects, ->(ids) { where(target_project_id: ids) }
scope :from_project, ->(project) { where(source_project_id: project.id) }
diff --git a/app/models/user.rb b/app/models/user.rb
index 31e975b8e53..457ba05fb04 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -587,10 +587,6 @@ class User < ActiveRecord::Base
name.split.first unless name.blank?
end
- def cared_merge_requests
- MergeRequest.cared(self)
- end
-
def projects_limit_left
projects_limit - personal_projects.count
end
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index 4bdd46a581d..d057c9cf6e9 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -134,15 +134,6 @@ describe Issue, models: true do
end
end
- describe '#is_being_reassigned?' do
- it 'returns issues assigned to user' do
- user = create(:user)
- create_list(:issue, 2, assignee: user)
-
- expect(Issue.open_for(user).count).to eq 2
- end
- end
-
describe '#closed_by_merge_requests' do
let(:project) { create(:project, :repository) }
let(:issue) { create(:issue, project: project)}