rails/rails — pull request #16857 by dtaniwaki (2014-09-10 02:47:03+00:00)
Title: Support any args in NilClass#to_s

Hi,

Rails extends DateTime to receive one argument so I think we should extend NilClass to avoid the following error.

```ruby
> user = User.new
> user.deleted_at.to_s :db
ArgumentError: wrong number of arguments (1 for 0)
```

Datetime values of ActiveRecord can often be `nil`, but everyone forget it then call this method in this way.

My current workaround is here.

```ruby
> user = User.new
> user.deleted_at.try(:to_s, :db)
nil
```

However, it doesn't make sense that we wrap it with try everywhere.