Commit a2a00600 authored by Riyad Preukschas's avatar Riyad Preukschas

Rename Upvote role to Votes

parent 06c1a8a9
class Issue < ActiveRecord::Base class Issue < ActiveRecord::Base
include IssueCommonality include IssueCommonality
include Upvote include Votes
acts_as_taggable_on :labels acts_as_taggable_on :labels
......
...@@ -2,7 +2,7 @@ require File.join(Rails.root, "app/models/commit") ...@@ -2,7 +2,7 @@ require File.join(Rails.root, "app/models/commit")
class MergeRequest < ActiveRecord::Base class MergeRequest < ActiveRecord::Base
include IssueCommonality include IssueCommonality
include Upvote include Votes
BROKEN_DIFF = "--broken-diff" BROKEN_DIFF = "--broken-diff"
......
module Upvote module Votes
# Return the number of +1 comments (upvotes) # Return the number of +1 comments (upvotes)
def upvotes def upvotes
notes.select(&:upvote?).size notes.select(&:upvote?).size
......
...@@ -12,7 +12,7 @@ describe Issue do ...@@ -12,7 +12,7 @@ describe Issue do
describe 'modules' do describe 'modules' do
it { should include_module(IssueCommonality) } it { should include_module(IssueCommonality) }
it { should include_module(Upvote) } it { should include_module(Votes) }
end end
subject { Factory.create(:issue) } subject { Factory.create(:issue) }
......
...@@ -8,6 +8,6 @@ describe MergeRequest do ...@@ -8,6 +8,6 @@ describe MergeRequest do
describe 'modules' do describe 'modules' do
it { should include_module(IssueCommonality) } it { should include_module(IssueCommonality) }
it { should include_module(Upvote) } it { should include_module(Votes) }
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment