Skip to content
  • Ryuta Kamizono's avatar
    7ae406a8
    Allow attribute aliases for `validates_uniqueness_of` · 7ae406a8
    Ryuta Kamizono authored
    For now, the target attribute allows attribute aliases, but `:scope`'s
    attribute does not, the cause is that the former use
    `read_attribute_for_validation`, but the latter does not.
    
    Unfortunately we cannot use `read_attribute_for_validation` in this
    case, it intentionally bypass custom attribute getter to allow #7072.
    
    To work both alias and #7072, `read_attribute` should be used to resolve
    attribute aliases.
    7ae406a8
    Allow attribute aliases for `validates_uniqueness_of`
    Ryuta Kamizono authored
    For now, the target attribute allows attribute aliases, but `:scope`'s
    attribute does not, the cause is that the former use
    `read_attribute_for_validation`, but the latter does not.
    
    Unfortunately we cannot use `read_attribute_for_validation` in this
    case, it intentionally bypass custom attribute getter to allow #7072.
    
    To work both alias and #7072, `read_attribute` should be used to resolve
    attribute aliases.
Loading