create an scope to sort files by a given field