rails/rails — pull request #13008 by ktheory (2013-11-22 19:07:08+00:00)
Title: Support SQL sanitization in AR::QueryMethods#order

Add support for sanitizing arrays in SQL ORDER clauses.

This is useful when using MySQL `ORDER BY FIELD()` to return records in
a predetermined way.

```ruby
Tag.order(['field(id, ?', [1,3,2]].to_sql
# => SELECT "tags".* FROM "tags" ORDER BY field(id, 1,3,2)
```

Prior to this, developers must be careful to sanitize `#order` arguments
themselves.