Module: ActForm::Combinable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/act_form/combinable.rb
Overview
rubocop:disable Style/Documentation
Instance Method Summary collapse
Instance Method Details
#combined_forms_valid?(context) ⇒ Boolean
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/act_form/combinable.rb', line 20 def combined_forms_valid?(context) return if _forms.empty? _forms.each do |form_class| form = form_class.new(attributes) form.valid?(context) form.errors.details.each do |attr_name, arr| arr.each do |error| next if error[:error] == :required errors.add(attr_name, error[:error]) end end end end |
#valid?(context = nil) ⇒ Boolean
14 15 16 17 18 |
# File 'lib/act_form/combinable.rb', line 14 def valid?(context = nil) super combined_forms_valid?(context) errors.empty? end |