Class: ActionController::Parameters
- Inherits:
-
Object
- Object
- ActionController::Parameters
- Defined in:
- lib/ca/validation/core_ext.rb
Instance Method Summary collapse
Instance Method Details
#errors(full: false) ⇒ Object
9 10 11 |
# File 'lib/ca/validation/core_ext.rb', line 9 def errors(full: false) @result.(full: full) end |
#result ⇒ Object
13 14 15 |
# File 'lib/ca/validation/core_ext.rb', line 13 def result @result.to_hash end |
#valid?(validator) ⇒ Boolean
3 4 5 6 7 |
# File 'lib/ca/validation/core_ext.rb', line 3 def valid?(validator) dup_params = deep_dup @result = validator.call(dup_params.permit!.to_hash) @result.errors.empty? end |