38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'motion-prime/sections/form/base_field_section.rb', line 38
def observe_model_errors
prepare_table_data
return unless observing_errors?
on_error_change = proc { |old_value, new_value|
changes = observing_errors_for.errors.changes
errors_observer_fields.each do |field|
next unless changes.has_key?(field)
if @status_for_updated == :rendered
reload_section
else
create_elements!
form.reload_collection_data
end
end
}.weak!
observe observing_errors_for.errors, :info, &on_error_change
end
|