Fix for Rails 3.2

* Now class_attribute is used instead of write_inheritable_attribute.
* Also a call to read_inheritable_attribute is fixed.