Hi. I have a question about activerecord, computed columns and to_xml.
I have a simple model called person that has a first_name and a
last_name field (and thus a first_name and last_name field in the Person
table). When I :find a model and call to_xml, I would like the result
to not only send back first name and last name as xml but also add an
additional attribute called full_name that is “last_name, first_name” I
would like to put this logic in my model. I have made a def that
returns this in the model - so you can call theperson.fullname in the
console and it will return last_name, first_name. However, I would like
to_xml to do this also. This is basically the concept of a computed
column. I tried adding to the column hash in Person and many other
ideas but nothing works. Can anyone help with this? Thanks very much.