All actions in law or in equity pending in any court in favor of or against any city or village annexed or merged with a city of the metropolitan class as provided in sections 14-117 to 14-125 at the time such annexation or merger takes effect shall be prosecuted by or defended by such city of the metropolitan class. All rights of action existing against any city or village consolidated with such city of the metropolitan class at the time of such consolidation, or accruing thereafter on account of any transaction had with or under any law or ordinance of such city or village, may be prosecuted against such city of the metropolitan class as existing after annexation or merger.