rails/rails — pull request #15365 by seuros (2014-05-27 10:13:30+00:00)
Title: Treat invalid uuid as nil

When an invalid value is set for an uuid field, Postgresql raise a casting error.
```
ActiveRecord::StatementInvalid: PG::InvalidTextRepresentation: ERROR: invalid input syntax for uuid: "foobar"
```
Previously we had a to validate the format for every uuid manually. This PR converts all invalid uuid to nil.