Converted class level method to scope

- Rails 4 requires all scopes to be converted to lambdas
- In a9519ae i had converted this scope which was giving error at
- that time as it was not lambda to class level method
- Reverting it here and converting it to a scope with lambda