rschema 2.4.0 → 3.0.1.pre1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +0,0 @@
1
- module RSchema
2
- module RailsInterop
3
- ParamSchemaValidationError = Class.new(StandardError)
4
-
5
- module ControllerMethods
6
- def params_for_schema!(schema_arg = nil, &block)
7
- schema = schema_arg || RSchema.schema(&block)
8
- value = self.params
9
- coerced, error = RSchema.coerce(schema, value)
10
- if error
11
- raise ParamSchemaValidationError.new(schema: schema, params: value, error: e)
12
- else
13
- coerced
14
- end
15
- end
16
- end
17
-
18
- end
19
- end