diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2017-04-07 07:14:27 +0200 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2017-04-07 07:21:34 +0200 |
commit | 370fd105bc2fd44de55306226502ba33d10ee14e (patch) | |
tree | aed305406fe2611dd9c3ad00b7f8dd2bbf1c50ac | |
parent | 46e4ed6bd0c8c256bce6d35b4bb992d77fd09971 (diff) | |
download | gitlab-ce-370fd105bc2fd44de55306226502ba33d10ee14e.tar.gz |
Removed `Milestone#is_empty?`
Removed `Milestone#is_empty?` because is not used anymore in the codebase
-rw-r--r-- | app/models/milestone.rb | 4 | ||||
-rw-r--r-- | changelogs/unreleased/30056-rename-milestones-empty.yml | 4 | ||||
-rw-r--r-- | spec/models/milestone_spec.rb | 12 |
3 files changed, 4 insertions, 16 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index ac205b9b738..652b1551928 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -153,10 +153,6 @@ class Milestone < ActiveRecord::Base active? && issues.opened.count.zero? end - def is_empty?(user = nil) - total_items_count(user).zero? - end - def author_id nil end diff --git a/changelogs/unreleased/30056-rename-milestones-empty.yml b/changelogs/unreleased/30056-rename-milestones-empty.yml new file mode 100644 index 00000000000..85db342b6df --- /dev/null +++ b/changelogs/unreleased/30056-rename-milestones-empty.yml @@ -0,0 +1,4 @@ +--- +title: Removed Milestone#is_empty? +merge_request: 10523 +author: Jacopo Beschi @jacopo-beschi diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index f3f48f951a8..e3e8e6d571c 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -109,18 +109,6 @@ describe Milestone, models: true do it { expect(milestone.percent_complete(user)).to eq(75) } end - describe '#is_empty?' do - before do - milestone.issues << create(:issue, project: project) - milestone.issues << create(:closed_issue, project: project) - milestone.merge_requests << create(:merge_request) - end - - it { expect(milestone.closed_items_count(user)).to eq(1) } - it { expect(milestone.total_items_count(user)).to eq(3) } - it { expect(milestone.is_empty?(user)).to be_falsey } - end - describe '#can_be_closed?' do it { expect(milestone.can_be_closed?).to be_truthy } end |