upgrading to Rails 4: removing extra join in scope; fixing page scroll in tests