Use register_class_with_limit

Refer https://github.com/rails/rails/commit/111990513b20c045d4af08b20f07f98c7e2c0b92
Merge pull request #502 from yahonda/rails42_register_class_with_limit

Rails4.2 Use register_class_with_limit