If a justice of the peace fails to allow an appeal in a cause where the appeal ought to be allowed, the circuit court or the judge thereof in vacation, on such facts appearing satisfactorily, may by rule and attachment compel the justice of the peace to allow the appeal, and return the record of his proceedings in the suit, together with the papers required to be returned by him.