How can I make a property aware of changes on another?

I have a model that needs to update a property whenever another property
changes, i.e. changing the model ‘type’ property updates the
‘description’ property with another value.
I don’t know how to get access to the underlying fields handled by rails
within a model class.

Thanks,

Daniel

Hello Daniel,
It sounds like you are looking for the magic that makes the Observer
design pattern happen. In Ruby this is done using the Observable module.
Example code here ;

FYI, I have NOT tried this under rails, but, I would be intrigued to

hear how you get along with it. Let us all know how it goes :wink:
Regards
Stef