lib/readymade/form.rb in readymade-0.1.0 vs lib/readymade/form.rb in readymade-0.1.1

- old
+ new

@@ -83,13 +83,14 @@ def sync_errors(from: self, to: record) return if [from, to].any?(&:blank?) errors = from.errors.instance_variable_get('@messages') - errors.merge!(to.errors.instance_variable_get('@messages')) + errors.to_h.merge!(to.errors.instance_variable_get('@messages')) to.errors.instance_variable_set('@messages', errors) - to.errors.messages.transform_values!(&:uniq) + to.errors.messages.transform_values!(&:uniq) # Does not work with rails 6.1 + rescue FrozenError => _e end def humanized_name self.class.name.underscore.split('/')[0] end