Changed scope of active record calls