Chapter twenty-three of this code providing compensation for workers injured during the course of their employment shall not apply to a person injured while participating in a ridesharing arrangement between his or her place of residence and place of employment or termini near such places: Provided, That if the employer owns, leases or contracts for the motor vehicle used in such arrangement, chapter twenty-three shall apply.