Prefer to use `if`s over Array#max for performance

https://gist.github.com/yuki24/e8d89597efa0fbdfe775
Test against Ruby 2.2
Only test against Rails edge + Ruby 2.2