Fixed Rails 4.1 compatibility issue: changed from before_configuration hook to before_initialize