-
Austen Madden authored
The docs imply that when specified the `on` option of `validates_associated` should be respected by the validated association. Prior to this change the validation context used will simply be the default behavior as if no `on` option were specified. With this change, the validation_context of the parent record is passed to the `valid?` check. When associations are created or updated allow them to use their own default context according to their own persistence status rather than overriding with the context of their associated object. Fixes #46239 Co-authored-by:
Alex Ghiculescu <alex@tanda.co> Co-authored-by:
Rafał Brize <rafal@buyapowa.com>
Austen Madden authoredThe docs imply that when specified the `on` option of `validates_associated` should be respected by the validated association. Prior to this change the validation context used will simply be the default behavior as if no `on` option were specified. With this change, the validation_context of the parent record is passed to the `valid?` check. When associations are created or updated allow them to use their own default context according to their own persistence status rather than overriding with the context of their associated object. Fixes #46239 Co-authored-by:
Alex Ghiculescu <alex@tanda.co> Co-authored-by:
Rafał Brize <rafal@buyapowa.com>
Loading