Former pub near Boroughbridge to be converted into flats