Calling `when variant.id in enterprise_rules` raised an error when enterprise_rules was null. Fixing this then revealed a missing require statement in a controller.