lib/grape/validations/regexp.rb in grape-0.2.6 vs lib/grape/validations/regexp.rb in grape-0.3.0
- old
+ new
@@ -2,10 +2,11 @@
module Validations
class RegexpValidator < SingleOptionValidator
def validate_param!(attr_name, params)
if params[attr_name] && !( params[attr_name].to_s =~ @option )
- raise Grape::Exceptions::ValidationError, :status => 400, :param => attr_name, :message => i18n_message(:regexp, attr_name)
+ raise Grape::Exceptions::Validation, :status => 400,
+ :param => @scope.full_name(attr_name), :message_key => :regexp
end
end
end
end