Commit 26d28ea0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'rs-abuse-report-validation' into 'master'

Use a more sensible message for the AbuseReport uniqueness validation

Previously it was "user has already been taken", when really we were
saying the user has already been reported.

See merge request !2461
parents a6e073fa d6337553
......@@ -17,7 +17,7 @@ class AbuseReport < ActiveRecord::Base
validates :reporter, presence: true
validates :user, presence: true
validates :message, presence: true
validates :user_id, uniqueness: true
validates :user_id, uniqueness: { message: 'has already been reported' }
def remove_user
......@@ -26,7 +26,7 @@
it { validate_presence_of(:reporter) }
it { validate_presence_of(:user) }
it { validate_presence_of(:message) }
it { validate_uniqueness_of(:user_id) }
it { validate_uniqueness_of(:user_id).with_message('has already been reported') }
describe '#remove_user' do
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