rails/rails — pull request #8813 by greyblake (2013-01-08 14:49:19+00:00)
Title: Write timestamps only if there are timestamps columns

Let's we have a model:

```ruby
# Has no timestamps columns in DB but has accessor methods
class Model < ActiveRecord::Base
attr_accessor :created_at, :updated_at
end
```

On save in will produce deprecation warning:
```
DEPRECATION WARNING: You're trying to create an attribute `created_at'. Writing arbitrary attributes on a model is deprecated. Please just use `attr_writer` etc

DEPRECATION WARNING: You're trying to create an attribute `updated_at'. Writing arbitrary attributes on a model is deprecated. Please just use `attr_writer` etc
```

So Rails tries to use `write_attribute` to assign this values. But there is no such attribute. So I think it should depend on real `attributes`, then just result of `resond_to?`.

Or at least it should use `send("#{attribute_name}=", value)` if it's depends on `respond_to` method.

Thanks.