This case is before us on the return to an alternative writ of mandamus commanding the respondents to show cause why a peremptory writ should hot go directing the respondents to issue to relator a permit for the erection of • a building. The record is confusing: it consists of a rale to show cause why a writ of mandamus should not issue, alternative writ, with a return by the municipality defendant which admits all the essential facts laid in the writ, avers a proposed zoning ordinance not adopted until months after the relator applied to the building inspector for a building permit, to which he was entitled under defendants ordinance; that in contemplation of the adoption of the zoning ordinance defendant passed a resolution forbidding the inspector to grant the permit, although he had approved the plans and specifications as complying with the building code in force in the defendant municipality, a return by the other defendant, the building inspector, which admitted the facts set out in the writ. The relator filed an answer in the nature of a demurrer, setting out additional facts, and conceiving he was required to prove some of the facts averred in his answer, obtained a rule to *290take depositions, and under it both parties took proofs. This was an irregular proceeding as the disputed facts should have been determined by- a jury on an issue certified to a trial court, yet as both parties have submitted the case on this record, and substantial justice can be done by treating relator’s pleading as a demurrer, we will deal with the case from that aspect. The record shows that relator applied to the inspector of buildings for a permit to erect a garage, who approved the plans as being according to the building code, and relator would have been entitled to his permit unless the following circumstances justified its refusal, it being the duty of the inspector under the municipal ordinance to grant or refuse it within three days after application. The plans and specifications were approved by the inspector June 16th, 1921, and if the relator was entitled to a permit it should have been issued within three days after.
On February 28th, 1921, the respondents-had before them a proposed zoning ordinance, which if in force would .have justified a refusal, but this proposed ordinance was abandoned and a new one introduced August 15th, 1921, which was not adopted until January 3d, 1922; there was, therefore, no zoning ordinance in force when the application for the permit was applied for. But while the ordinance, subsequently abandoned, was pending, and with its adoption in view, the respondents adopted a resolution prohibiting the inspector from granting any permits except for dwellings. We do not think that the respondents had any lawful right, before a zoning ordinance' was in force to, by resolution, practically put in force a zoning ordinance not existing, for it amounted to a discrimination between buildings, to be established by the zoning ordinance, and, therefore, relator was entitled to his permit under the building code. The effect of the resolution was to apply a rule which it was intended to establish by a future ordinance, and if this could be done there was no need of the zoning ordinance, for the erection of any building could be arbitrarily prevented by resolution. At the time the relator applied he had complied with the building code *291and as there was no preventive ordinance, his plans having been approved as required by ordinance, he was entitled to his permit.
The peremptory writ should go.