Sometimes you might want to know if an attribute is an associated object or a simple string, integer etc. You can use the 
  reflect_on_association
  
    Show archive.org snapshot
  
 method for that.
if Person.reflect_on_association(:address)
  Person.address.attributes # do something
else
  Person.address # do something else
end
Posted by Dominik Schöler to makandra dev (2011-03-08 16:11)