Replace on_load with instance_eval

Addresses https://github.com/rails/rails/issues/9461