Skip to content

Fix double-validation bug when using inline validates: on property in subclasses#541

Open
lucasmazza wants to merge 1 commit into
trailblazer:masterfrom
tremendous-rewards:fix-double-validation
Open

Fix double-validation bug when using inline validates: on property in subclasses#541
lucasmazza wants to merge 1 commit into
trailblazer:masterfrom
tremendous-rewards:fix-double-validation

Conversation

@lucasmazza

Copy link
Copy Markdown

When property :name, validates: { presence: true } is used on a form that has subclasses, the heritage replay would call validates again during subclass creation if _inherited: true is set in the options. This guard skips the redundant re-registration since the :validation heritage entry already handles propagating validators to subclasses.

Fixes: trailblazer/reform-rails#59
Fixes: #323

… subclasses

When `property :name, validates: { presence: true }` is used on a form that
has subclasses, the heritage replay would call `validates` again during
subclass creation if `_inherited: true` is set in the options. This guard
skips the redundant re-registration since the `:validation` heritage entry
already handles propagating validators to subclasses.

Fixes: trailblazer/reform-rails#59
Fixes: trailblazer#323
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validates: { ... } duplicate error messages Error messages are duplicate

1 participant