rails/rails — pull request #17149 by twohlix (2014-10-02 23:04:47+00:00)
Title: Added add_once to ActiveModel::Errors

add_once adds a message to an attribute only if that attribute
does not already have that message as an error.

This simplifies code I've used in models such as:
```ruby
message = "Some Error Message"
errors.add(:some_attribute, message) unless errors.added?(:some_attribute, message)
```
to
```ruby
errors.add_once(:some_attribute, "Some Error Message")
```

`add_once` makes use of `add` and `added?`. Added some tests too along the lines of `add`'s tests.