Rails4.2 Use register_class_with_limit

Refer https://github.com/rails/rails/commit/111990513b20c045d4af08b20f07f98c7e2c0b92