• R
    Fix aggregate functions to return numeric value consistently even on custom attribute type · 89e1dd61
    Ryuta Kamizono 提交于
    Currently, `count` and `average` always returns numeric value, but
    `sum`, `maximum`, and `minimum` not always return numeric value if
    aggregated on custom attribute type.
    
    I think that inconsistent behavior is surprising:
    
    ```ruby
    # All adapters except postgresql adapter are affected
    # by custom type casting.
    
    Book.group(:status).sum(:status)
    # => { "proposed" => "proposed", "published" => nil }
    ```
    
    That is caused by fallback looking up cast type to `type_for(column)`.
    Now all supported adapters can return numeric value without that
    fallback, so I think we can remove that, it will also fix aggregate
    functions to return numeric value consistently.
    89e1dd61
可在Tags中查看这些版本中当前仓库的状态.
CHANGELOG.md 19.5 KB