Skip to content
  • Austen Madden's avatar
    e1e79814
    Pass validation_context to validates_associated · e1e79814
    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: default avatarAlex Ghiculescu <alex@tanda.co>
    Co-authored-by: default avatarRafał Brize <rafal@buyapowa.com>
    e1e79814
    Pass validation_context to validates_associated
    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: default avatarAlex Ghiculescu <alex@tanda.co>
    Co-authored-by: default avatarRafał Brize <rafal@buyapowa.com>
Loading