Class method all_#{name} failed to apply default_scope. The fix is simple. Instead of calling "queryable", we use "all" which creates the valid Mongoid query object that includes the default scope. If we want to skip the default scope we add "unscoped" like this: Class.unscoped.all_tags
Default scope is often used to enforce account scope on multi-tenant projects. Without default scope being honored, the all_#{name} method returns all items found across tenants.
Class method all_#{name} failed to apply default_scope. The fix is simple. Instead of calling "queryable", we use "all" which creates the valid Mongoid query object that includes the default scope. If we want to skip the default scope we add "unscoped" like this:
Class.unscoped.all_tags
Default scope is often used to enforce account scope on multi-tenant projects. Without default scope being honored, the all_#{name} method returns all items found across tenants.