Revamped note form options.

This commit is contained in:
Riyad Preukschas 2012-12-03 22:34:50 +01:00
parent 4ed8278870
commit b47173da6a
4 changed files with 101 additions and 90 deletions

View file

@ -140,24 +140,6 @@ class Note < ActiveRecord::Base
@notify_author ||= false
end
# Check if we can notify commit author
# with email about our comment
#
# If commit author email exist in project
# and commit author is not passed user we can
# send email to him
#
# params:
# user - current user
#
# return:
# Boolean
#
def notify_only_author?(user)
for_commit? && commit_author &&
commit_author.email != user.email
end
# Returns true if this is an upvote note,
# otherwise false is returned
def upvote?