Rails 4 scope compatibility fix.