I make the following call to the DB.
@patientRegistration = PatientRegistration.find(:all,
:conditions=>["name = '#{patientName}'"])
This searches for a patient registration based on a given name. I get a valid @patientRegistration
object. When I invoke @patientRegistration.inspect
it prints correctly all the values for the object in the DB.
But when I try to read a particular attribute (say id or name) by doing the following: @patientRegistration.id
or @patientRegistration.name
, I get invalid values. Either its blank or some junk values. I don't understand how inspect is able to retrieve all the values correctly but reading individual attributes gives invalid values.
Thanks