def valid?(document_or_id)
      # FIXME Hashie::Mash will always respond to #valid?
      if not model? or not model.respond_to?(:valid?)
        return true
      end

      validator = model.class.new(document_or_id)

      # Return true if validator is a Hash with errors key !
      # FIXME Hashie::Mash will always respond to #valid?
      if validator.key? :valid? or validator.key? :errors
        return true
      end

      valid = validator.valid?

      if validator.errors.nil?
        return true
      end

      @errors = validator.errors # store to avoid revalidating
      valid = case valid
        when true, nil
          true
        when false
          false
      end
      valid
    end
def valid?(document_or_id)
      # FIXME Hashie::Mash will always respond to #valid?
      if not model? or not model.respond_to?(:valid?)
        return true
      end

      validator = model.class.new(document_or_id)

      # Return true if validator is a Hash with errors key !
      # FIXME Hashie::Mash will always respond to #valid?
      if validator.key? :valid? or validator.key? :errors
        return true
      end

      valid = validator.valid?

      if validator.errors.nil?
        return true
      end

      @errors = validator.errors # store to avoid revalidating
      valid = case valid
        when true, nil
          true
        when false
          false
      end
      valid
    end
Valid?