Fix scopes for rails 4