changed scope to return a lambda for Rails 4