Rails 4 scope fixes