rails/rails — pull request #4408 by tomstuart (2012-01-11 10:48:57+00:00)
Title: #[] and #[]= are no longer interchangeable with #read_attribute and #write_attribute

21eadc1 forced `ActiveRecord::Base#[]` and `#[]=` to use the default implementations of `#read_attribute` and `#write_attribute` respectively; if one of the latter methods is redefined, or wrapped with `alias_method_chain`, its alias will retain the default behaviour.

I don't think this change in semantics was intentional, so I've added tests for the expected behaviour and reverted 21eadc1 to make them pass.