amahi/platform

View on GitHub
app/validators/user_not_exist_in_system_validator.rb

Summary

Maintainability
A
0 mins
Test Coverage
class UserNotExistInSystemValidator < ActiveModel::EachValidator
  def validate_each(object, attribute, value)
    unless User.is_valid_name?(value)
      object.errors[:login] << options[:message]
    end
  end
end