Councillors have approved plans for 24 assisted living apartments in Selby as part of a scheme first proposed a decade ago.