# Dirty objects and overload attribute read/write methods

**URL:** <https://www.ruby-forum.com/t/dirty-objects-and-overload-attribute-read-write-methods/166930>\
**Category:** Rails\
**Created:** [May 1, 2009, 1:50am UTC](https://www.ruby-forum.com/t/dirty-objects-and-overload-attribute-read-write-methods/166930 "2009-05-01T01:50:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![syg6](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@syg6](https://www.ruby-forum.com/u/syg6)\
**Post date:** [May 1, 2009, 1:50am UTC](https://www.ruby-forum.com/t/dirty-objects-and-overload-attribute-read-write-methods/166930/1 "2009-05-01T01:50:29Z")

</div>

Hi,

I’m trying to use dirty fields but keep running into trouble with  
attributes that I’ve overloaded. It looks like the dirty.rb module  
uses read\_attribute and to figure out the old value. Unfortunately  
this is before my overloaded methods have done their work. Therefore,  
the “old” value is not yet transformed and, hence, incorrect. I’ve  
pasted a little example here:

[http://pastie.org/464578](http://pastie.org/464578)

Can anyone help me with a solution?

Thanks,  
Bob
