def delete
      if self.class.hooks[:active]
        self.class.hooks[:before_delete].each do |block|
          self.class.hooks[:active] = false
          block.yield self
          self.class.hooks[:active] = true
        end
      end

      st = prepare("DELETE FROM #{table} WHERE #{pk_clause}")
      num_deleted = st.execute( *pk_values ).affected_count
      st.finish
      if num_deleted != 1
        false
      else
        if self.class.hooks[:active]
          self.class.hooks[:after_delete].each do |block|
            self.class.hooks[:active] = false
            block.yield self
            self.class.hooks[:active] = true
          end
        end
        true
      end
    end
def delete
      if self.class.hooks[:active]
        self.class.hooks[:before_delete].each do |block|
          self.class.hooks[:active] = false
          block.yield self
          self.class.hooks[:active] = true
        end
      end

      st = prepare("DELETE FROM #{table} WHERE #{pk_clause}")
      num_deleted = st.execute( *pk_values ).affected_count
      st.finish
      if num_deleted != 1
        false
      else
        if self.class.hooks[:active]
          self.class.hooks[:after_delete].each do |block|
            self.class.hooks[:active] = false
            block.yield self
            self.class.hooks[:active] = true
          end
        end
        true
      end
    end
Returns true iff the record and only the record was successfully deleted.