fix scopeByDate for to scope between from and to correctly