Fixes scopes for Rails 4.