Skip to content
  • Ryuta Kamizono's avatar
    2fece903
    Fix numericality validator not to be affected by custom getter · 2fece903
    Ryuta Kamizono authored
    Since fe9547b6, numericality validator would parse raw value only when a
    value came from user to work type casting to a value from database.
    
    But that was caused a regression that the validator would work against
    getter value instead of parsed raw value, a getter is sometimes
    customized by people. #33550
    
    There we never guarantees that the value before type cast was going to
    the used in this validation (actually here is only place that getter
    value might not be used), but we should not change the behavior unless
    there is some particular reason.
    
    The purpose of fe9547b6 is to work type casting to a value from
    database. We could achieve the purpose by using `read_attribute`,
    without using getter value.
    
    Fixes #33550.
    2fece903
    Fix numericality validator not to be affected by custom getter
    Ryuta Kamizono authored
    Since fe9547b6, numericality validator would parse raw value only when a
    value came from user to work type casting to a value from database.
    
    But that was caused a regression that the validator would work against
    getter value instead of parsed raw value, a getter is sometimes
    customized by people. #33550
    
    There we never guarantees that the value before type cast was going to
    the used in this validation (actually here is only place that getter
    value might not be used), but we should not change the behavior unless
    there is some particular reason.
    
    The purpose of fe9547b6 is to work type casting to a value from
    database. We could achieve the purpose by using `read_attribute`,
    without using getter value.
    
    Fixes #33550.
Loading