Fix Rails 4 deprecation warnings for scoped and references

Did not get tests running so this could break rails 3.2 given use of all instead of scoped - probably not the safest way to fix but submitting for discussion.