Reference for Sanhedrin 222:11
שנאמר (דברים יג, יז) ושרפת באש את העיר ואת כל שללה כליל לה' אלהיך שללה ולא שלל שמים מכאן אמרו ההקדשות שבה יפדו ותרומות ירקבו מעשר שני וכתבי הקדש יגנזו
THOU SHALT SURELY SMITE THE INHABITANTS OF THAT CITY WITH THE EDGE OF THE SWORD.<span class="x" onmousemove="('comment',' Ibid. 26. ');"><sup>20</sup></span> A COMPANY OF ASS-DRIVERS OR CAMEL-DRIVERS PASSING FROM PLACE TO PLACE SAVES IT.<span class="x" onmousemove="('comment',' If a travelling caravan made a thirty days' halt in the town, its members are regarded as inhabitants. Consequently, if they resist seduction, and their abstention turns the remainder who abstain from idolatry too, and would otherwise be in a minority, into a majority, the town is saved from the fate of a condemned city. — This is followed in the text by 'as it is said etc.' But as the deduction is from 'inhabitants', not from the verse next quoted, the Wilna Gaon deletes 'as it is said'. [Yad Ramah preserves another reading: 'they are saved', that is, if the caravan passing through the city becomes involved in the seduction, they do not share the fate of the inhabitants, but are treated as individual idolators, provided they did not halt for thirty days.] ');"><sup>21</sup></span>