def read_attribute(attr_name, options={})
attr_name = attr_name.to_s
column = column_for_attribute(attr_name)
if column
if @attributes.has_key?(attr_name) and options.blank?
super(attr_name)
elsif !(is_loaded?(attr_name)) and attr_name != self.class.primary_key and !new_record?
unless self.all_attributes_loaded? and attr_name =~ /\A#{self.class.default_family}:/
if options.blank?
options[:timestamp] = self.updated_at.to_bigrecord_timestamp if self.has_attribute?("#{self.class.default_family}:updated_at") and self.updated_at
value = connection.get(self.class.table_name, self.id, attr_name, options)
set_loaded(attr_name)
write_attribute(attr_name, column.type_cast(value))
else
options[:timestamp] ||= self.updated_at.to_bigrecord_timestamp if self.has_attribute?("#{self.class.default_family}:updated_at") and self.updated_at
value = connection.get(self.class.table_name, self.id, attr_name, options)
if options[:versions] and options[:versions] > 1
value.collect{ |v| column.type_cast(v) }
else
column.type_cast(value)
end
end
else
write_attribute(attr_name, column.default)
end
else
write_attribute(attr_name, column.default)
end
else
nil
end
end