I am building a gallery index of Items in which some Items have photos and others do not.
I would like to grab all of the Items (or a subset with will_paginate) and sort them first by the items with a photo (attached via Paperclip) and then by the record creation date.
I need a binary "has attachment" type status for the first part. Do I need to make some additional model attributes and use paperclip's callbacks to set the status of a binary column? Or is there a better way?
I would prefer to do this sorting at the DB level since we will be using will_paginate to cycle through blocks of records.
thanks in advance