Skip to content
  • Sean Griffin's avatar
    20f60f27
    Correctly handle multiple attribute method prefix/suffixes which match · 20f60f27
    Sean Griffin authored
    Active Record defines `attribute_method_suffix :?`. That suffix will
    match any predicate method when the lookup occurs in Active Model. This
    will make it incorrectly decide that `id_changed?` should not exist,
    because it attempts to determine if the attribute `id_changed` is
    present, rather than `id` with the `_changed?` suffix. Instead, we will
    look for any correct match.
    
    Fixes #17900
    20f60f27
    Correctly handle multiple attribute method prefix/suffixes which match
    Sean Griffin authored
    Active Record defines `attribute_method_suffix :?`. That suffix will
    match any predicate method when the lookup occurs in Active Model. This
    will make it incorrectly decide that `id_changed?` should not exist,
    because it attempts to determine if the attribute `id_changed` is
    present, rather than `id` with the `_changed?` suffix. Instead, we will
    look for any correct match.
    
    Fixes #17900
Loading