def to_hash
      return attributes if respond_to? :attributes
      serializer = Serializer.new(self)
      serializer.respond_to?(:attributes_hash) ?
        serializer.attributes_hash : 
        serializer.serializable_record
    end
def to_hash
      return attributes if respond_to? :attributes
      serializer = Serializer.new(self)
      serializer.respond_to?(:attributes_hash) ?
        serializer.attributes_hash : 
        serializer.serializable_record
    end
fix for thinking_sphinx equation in #instances_from_class:
 ids.collect {|obj_id| instances.detect do |obj| obj.primary_key_for_sphinx == obj_id end}
 where obj_id is Array
def primary_key_for_sphinx
  [read_attribute(self.class.primary_key_for_sphinx)]
end