rails/rails — pull request #10394 by BMorearty (2013-05-01 12:17:21+00:00)
Title: Remove varargs from `Object#in?`

I am the creator of the `in_enumerable` gem, whose `Object#in?` method was later incorporated into ActiveSupport.

I just discovered that in Rails 4, `in?` was modified to allow varargs. But [there is a good reason I didn't implement varargs](https://github.com/rails/rails/pull/258#issuecomment-985570) in the original implementation of `in?`: it would make the method's behavior ambiguous. [@dhh also didn't like the varargs version](https://github.com/rails/rails/pull/258#issuecomment-986523).

```ruby
# Test if "B" is included in a list of names with `"B".in?(*names)`:
names = ["BMorearty"]
"B".in?(*names) # => true

names = ["BMorearty","rubyduo"]
"B".in?(*names) # => false
```

An ambiguous method is worse than useless. People who call it will get unpredictable behavior.

In this pull request I revert `in?` back to its original useful, unambiguous behavior.