Tags: rootstrap/yaaf
Tags
Prevent double validations on save/save! (#70) * Prevent double validations on save/save! Originally, calling `form.save/!` would cause model validations to fire off twice. The first time when the form's validations are being run (as the form has a validation to ensure that all `models` are valid`) The second time is when the `models` are looped over and they each receive `save!`. For validations that are done with in-memory data, such as `validate :attribute, presence: true`, this isn't a big deal. But this could be problematic for any validation that is dependent on the state of the database (it will effectively hit the database twice). This instead passes `validate: false` into the saving of models so that their validations aren't run a second time. * Update README to reflect line count