lib/grape/validations/coerce.rb in grape-0.2.6 vs lib/grape/validations/coerce.rb in grape-0.3.0

- old
+ new

@@ -10,10 +10,11 @@ def validate_param!(attr_name, params) new_value = coerce_value(@option, params[attr_name]) if valid_type?(new_value) params[attr_name] = new_value else - raise Grape::Exceptions::ValidationError, :status => 400, :param => attr_name, :message => i18n_message(:coerce, attr_name) + raise Grape::Exceptions::Validation, :status => 400, + :param => @scope.full_name(attr_name), :message_key => :coerce end end class InvalidValue; end private