rails/rails — pull request #5236 by zenprogrammer (2012-03-02 01:14:19+00:00)
Title: Add ActiveModel subset validation helper

This is a validation helper that validates that the attribute is a subset of the specified list. Its usage looks like:

```
validates :answer, :subset, :in => ['unicorns', 'rainbows', 'horsies']
```

I found this useful in validating an Array attribute on one of my models. The attribute corresponded to a group of checkboxes in the view.

The attribute itself only needs to support the `each` method for iteration.