From 733c64ff2a12f1216219d9fc4e2c924f1c77bfe2 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 8 Mar 2013 17:14:40 -0500 Subject: [PATCH] fixes #744 --- app/models/comment_vote.rb | 6 +++--- config/locales/en.yml | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/models/comment_vote.rb b/app/models/comment_vote.rb index 0b27e13ac..a4c3831c2 100644 --- a/app/models/comment_vote.rb +++ b/app/models/comment_vote.rb @@ -5,7 +5,7 @@ class CommentVote < ActiveRecord::Base belongs_to :user before_validation :initialize_user, :on => :create validates_presence_of :user_id, :comment_id, :score - validates_uniqueness_of :user_id, :scope => :comment_id, :message => "has already voted for this comment" + validates_uniqueness_of :user_id, :scope => :comment_id, :message => "have already voted for this comment" validate :validate_user_can_vote validate :validate_comment_can_be_down_voted validates_inclusion_of :score, :in => [-1, 1], :message => "must be 1 or -1" @@ -27,7 +27,7 @@ class CommentVote < ActiveRecord::Base def validate_user_can_vote if !user.can_comment_vote? - errors.add :user, "can not comment vote" + errors.add :base, "You cannot vote on comments" false else true @@ -36,7 +36,7 @@ class CommentVote < ActiveRecord::Base def validate_comment_can_be_down_voted if is_negative? && comment.creator.is_janitor? - errors.add :user, "can not downvote a janitor comment" + errors.add :base, "You cannot downvote a janitor comment" false else true diff --git a/config/locales/en.yml b/config/locales/en.yml index af66c24ee..adfda1111 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -19,4 +19,10 @@ en: creator_id: "You" post_disapproval: post: "You" - post_id: "You" \ No newline at end of file + post_id: "You" + comment: + post: "You" + post_id: "You" + comment_vote: + comment: "You" + user_id: "You" \ No newline at end of file