You're defining a context here of "when :track_inventory_levels is true", without actually setting this configuration setting. I would prefer it if you actually set this configuration variable.