emulate behavior of activerecord::scoping::namedscope#scoped