Replace scoped with where(nil) as scoped was removed from Rails. See: http://stackoverflow.com/a/18199294 Fixes #5366