How to retrieve objects that have an attached file and order those objects based on a set of pre-ordered values?
问题 I am using Ruby on Rails 3.2.2 and Paperclip 2.7.0. I would like to retrieve data from the database where records/objects have an attached file (in my case it is an image file) and order those objects based on a set of pre-ordered values. That is, I have image_file_name (handled by the Paperclip gem) and status (status can be published , unpublished , blocked ) database table columns and I would like that: returned data contains primarily records/objects to which is associated an image (maybe