Is there any convenient way in Rails 3.2 to arrange an ActiveRecord relationship by moving records with a specific value for a specific field to the top of the relationship? For example, if MyModel has a country attribute, I would like to sort the relationships returned by any request, with entries that have country='Spain' before the front of the relationship.
MyModel
country
country='Spain'
Something like that. Obviously, "name, identifier" will depend on your model and requirements.
MyModel.order("country = 'Spain' DESC, name, id")