defined view_where function for users model