Cheating the Piper is a 1920 silent short animated film by Bray Productions, and is one of the cartoons based on the comic strip Jerry on the Job since the series started in 1916.
After the rat eats his sock and belt, Mr. Givney pulls out a revolver and guns down the rodent.
When Jerry plays on his instrument, the rats are mesmerized by the melody as they come out from various openings in the station.
Thinking the plan worked, Mr. Givney picks up Jerry like a beloved son, gives complimentary kisses, and carries him back to the station.
Jerry and Mr. Givney then cling onto the edges of the door, and watch the rats run back into the openings inside.