Remove a persisted YamlRecord object
 Returns true if destroyed; false otherwise

 === Example:

   @post = Post.create(:foo => "bar", :miso => "great")
   Post.all.size => 1
   @post.destroy  => true
   Post.all.size => 0
968801
def destroy
      run_callbacks(:before_destroy)
      new_data = self.class.all.reject { |item| item.persisted_attributes == self.persisted_attributes }.map { |item| item.persisted_attributes }
      self.class.write_contents(new_data)
      self.is_destroyed = true
      run_callbacks(:after_destroy)
      true
    rescue IOError
      false
    end
389934
def remove_record(self, record):
        
        if not self.has_record(record):
            current_app.logger.warning(
                'Community removal: record {uuid} was not in community '
                '"{comm}"'.format(uuid=record.id, comm=self.id))
        else:
            key = current_app.config['COMMUNITIES_RECORD_KEY']
            record[key] = [c for c in record[key] if c != self.id]

        if current_app.config['COMMUNITIES_OAI_ENABLED']:
            if self.oaiset.has_record(record):
                self.oaiset.remove_record(record)
924621
def destroy
      post = Blogo::Post.where(permalink: params[:id]).first!
      Blogo::DestroyPostService.new(post).destroy!

      flash[:notice] = I18n.translate('blogo.admin.post_removed')
      redirect_to blogo_admin_posts_path
    end
401098
def delete(self, model, commit=True):
        
        self.is_instance(model)
        db.session.delete(model)
        if commit:
            db.session.commit()

        return model
945506
def save
      return true if !new_record? && !changed?
      raise Exceptions::ValidationFailedException.new(errors) if !valid?
      destroy(false) if !new_record?

      parent.modify_engine do |nat|
        nat.add_redirect(name, protocol, "", hostport, "", guestport)
      end

      clear_dirty!
      existing_record!
      true
    end
739974
def destroy
      @post = LatoBlog::Post.find_by(id: params[:id])
      return unless check_post_presence

      unless @post.destroy
        flash[:danger] = @post.post_parent.errors.full_messages.to_sentence
        redirect_to lato_blog.edit_post_path(@post.id)
        return
      end

      flash[:success] = LANGUAGES[:lato_blog][:flashes][:post_destroy_success]
      redirect_to lato_blog.posts_path(status: 'deleted')
    end
144630
public function delete()
	{
		$this->verifyNotReadonly('delete');

		$pk = $this->valuesForPk();

		if (empty($pk))
			throw new ActiveRecordException("Cannot delete, no primary key defined for: " . get_called_class());

		if (!$this->invokeCallback('beforeDestroy',false))
			return false;

		static::table()->delete($pk);
		$this->invokeCallback('afterDestroy',false);

		return true;
	}
1138681
def destroy(update_collection=true)
      return if new_record?
      previous_name = name_changed? ? name_was : name
      parent.modify_engine do |nat|
        nat.remove_redirect(previous_name)
      end
      parent_collection.delete(self, true) if parent_collection && update_collection
      new_record!
      true
    end
93201
def destroy
      destroy_associations

      if persisted?
        IdentityMap.remove(self) if IdentityMap.enabled?
        pk         = self.class.primary_key
        column     = self.class.columns_hash[pk]
        substitute = connection.substitute_at(column, 0)

        relation = self.class.unscoped.where(
          self.class.arel_table[pk].eq(substitute))

        relation.bind_values = [[column, id]]
        relation.delete_all
      end

      @destroyed = true
      freeze
    end
1227860
public function destroy()
    {
        if (static::isVersioned()) {
            if (static::$createRevisionOnDestroy) {
                // save a copy to history table
                if ($this->fieldExists('Created')) {
                    $this->Created = time();
                }

                $recordValues = $this->_prepareRecordValues();
                $set = static::_mapValuesToSet($recordValues);

                DB::nonQuery(
                        'INSERT INTO `%s` SET %s',

                    [
                                static::getHistoryTable(),
                                join(',', $set),
                        ]
                );
            }
        }

        return static::delete($this->getPrimaryKeyValue());
    }
163757
def delete(key)
      deleted = @store.delete(key)
      @on_write_failure.call(key) if !deleted && @on_write_failure
      RecordCache::Base.logger.debug{ "Version Store: deleted #{key}" }
      deleted
    end
222293
def delete(self, record):
        
        index, doc_type = self.record_to_index(record)

        return self.client.delete(
            id=str(record.id),
            index=index,
            doc_type=doc_type,
        )
1227406
def destroy
      app_instance = MnoEnterprise::AppInstance.find(params[:id])

      if app_instance
        MnoEnterprise::EventLogger.info('app_destroy', current_user.id, 'App destroyed', app_instance)
        app_instance.terminate
      end

      head :accepted
    end
753327
def save_as_persisted_record
      new_attributes = attributes.reject { |k, _v| k.to_s =~ /^(id|uuid)$/ }
      self.class.update(id, new_attributes)
    end
689498
def save
      return true if !new_record? && !changed?
      raise Exceptions::ValidationFailedException.new(errors) if !valid?

      destroy if !new_record? && name_changed?

      parent.extra_data["#{key_prefix}Protocol"] = protocol
      parent.extra_data["#{key_prefix}GuestPort"] = guestport
      parent.extra_data["#{key_prefix}HostPort"] = hostport
      result = parent.extra_data.save

      clear_dirty!
      existing_record!

      result
    end
484201
def delete(self):
        

        if not self.object_id:
            return False

        url = self.build_url(
            self._endpoints.get('item').format(id=self.object_id))

        response = self.con.delete(url)
        if not response:
            return False

        self.object_id = None

        return True
125349
def destroy
      self.last_result_set = self.class.requestor.destroy(self)
      if last_result_set.has_errors?
        fill_errors
        false
      else
        mark_as_destroyed!
        self.relationships.last_result_set = nil
        _clear_cached_relationships
        _clear_belongs_to_params
        true
      end
    end