rails/rails — pull request #17793 by kamipo (2014-11-27 01:15:52+00:00)
Title: Fix undesirable RangeError by Type::Integer. Add Type::UnsignedInteger.

This PR separated from #17696.

```sql
CREATE TABLE `foos` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`unsigned_int` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
```

```
# rails c
Loading development environment (Rails 4.2.0.beta4)

irb(main):001:0> Foo.create(unsigned_int: 4294967295)
RangeError: 4294967295 is out of range for ActiveRecord::Type::Integer with limit 4

irb(main):002:0> Foo.connection.execute("INSERT INTO foos(unsigned_int) VALUES (4294967295)")
(4.7ms) INSERT INTO foos(unsigned_int) VALUES (4294967295)
=> nil

irb(main):003:0> Foo.where(unsigned_int: 4294967295).first
RangeError: 4294967295 is out of range for ActiveRecord::Type::Integer with limit 4

irb(main):004:0> Foo.connection.select_one("SELECT * FROM foos WHERE unsigned_int = 4294967295")
(6.3ms) SELECT * FROM foos WHERE unsigned_int = 4294967295
=> {"id"=>1, "unsigned_int"=>4294967295}
```