rails magic to get scopes working in a module