PATCH/PUT /posts/1
351111
def update
      post_params[:user_id] = @post.user_id
      respond_to do |format|
        if @post.update(post_params)
          format.json { render json: @post, status: 200 }
        else
          format.json { render json: @post.errors, status: :unprocessable_entity }
        end
      end
    end
331533
def patch(path, options = {}, &block)
      perform_request Net::HTTP::Patch, path, options, &block
    end
42416
def update_post_relations(user, topic, deleting=False):
    
    if deleting:
        user.post_count = user.post_count - 1
    else:
        user.post_count += 1
    user.save(update_fields=['post_count'])

    topic.modified     = datetime.now()
    topic.modified_int = time.time()
    topic.save(update_fields=['modified', 'modified_int'])
537847
def create_post(self, path, **kw):
        """"""
        content = kw.pop('content', None)
        onefile = kw.pop('onefile', False)
        # is_page is not used by create_post as of now.
        kw.pop('is_page', False)
        metadata = {}
        metadata.update(self.default_metadata)
        metadata.update(kw)
        makedirs(os.path.dirname(path))
        if not content.endswith('\n'):
            content += '\n'
        with io.open(path, "w+", encoding="utf8") as fd:
            if onefile:
                fd.write(write_metadata(metadata, comment_wrap=False, site=self.site, compiler=self))
            fd.write(content)
1235339
def post_update!(options = {})
      rsp = post(prepare_update_xml(options))
      success?(rsp.body) or log_error(rsp.body)
    end
5598
def update
      url = single_url
      payload = attributes_to_payload
      payload[:reset_data] = true
      to_server url, payload
    end
1054757
def _post_update_entries #:nodoc:
      post_up_entries = Array.new
      list_entries.each { |ent| 
        if @limit_to_dir_path # limit files returned to this (and subdir's of) dir
          fle = File.join(self.svn_repo_working_copy, ent[:entry_name])
          next unless fle.include? @limit_to_dir_path
        end
        post_up_entries.push ent[:entry_name]
      }

      added   = post_up_entries - @pre_up_entries
      removed = @pre_up_entries - post_up_entries

      #raise "#{post_up_entries}\n#{@pre_up_entries}"
      #raise "#{added} - #{removed}"

      if added.length > 0
          added.each {|e_add| @modified_entries.push "A\t#{e_add}" }
      end

      if  removed.length > 0
          removed.each {|e_rm| @modified_entries.push "D\t#{e_rm}" }
      end

    end
1169121
function doUpdate (root, entry, cb) {
    entry = utils.updateEntry(root, entry, ['dateDetected'])

    // console.log('overwriting', root, 'with', entryJSON, 'resulting in', entry.toJSON())
    put(entry, cb)
  }
493445
def patch(self, keepNull = True, **docArgs) :
        """"""

        if self.URL is None :
            raise ValueError("Cannot patch a document that was not previously saved")

        payload = self._store.getPatches()
        
        if self.collection._validation['on_save'] :
            self.validate()

        if len(payload) > 0 :
            params = dict(docArgs)
            params.update({'collection': self.collection.name, 'keepNull' : keepNull})
            payload = json.dumps(payload, default=str)

            r = self.connection.session.patch(self.URL, params = params, data = payload)
            data = r.json()
            if (r.status_code == 201 or r.status_code == 202) and "error" not in data :
                self._rev = data['_rev']
            else :
                raise UpdateError(data['errorMessage'], data)

            self.modified = False

        self._store.resetPatch()
139704
def patched(attrs, updates):
    """"""
    orig = patch(attrs, updates.items())
    try:
        yield orig
    finally:
        patch(attrs, orig.items())
878509
def add_posts(self, path='posts'):
		
		path = os.path.join(self.root_path, path)
		self.cm.add_posts([
			self.cm.Post.from_file(file)
			for file in _listfiles(path)
		])
210479
def put(path: nil, payload:, headers: {}, query: {})
      execute(method: :put, path: path, headers: headers, query: query, payload: payload)
    end
1263861
function patch(node) {
    var data = node.data || {};

    data.stem = stemmer(nlcstToString(node));

    node.data = data;
}
6586
function patchContent (content, parts) {
  return Object.keys(parts).reduce((content, type) => {
    let paths = parts[type].filter(({ valid }) => valid).map(({ path }) => path)
    return patchType(content, type, paths)
  }, content)
}
1248417
def patch(attrs, updates):
    """"""
    orig = {}
    for attr, value in updates:
        orig[attr] = attrs[attr]
        attrs[attr] = value
    return orig
278329
def mark_for_update(self):
        '''
            
        '''
        self.pub_statuses.exclude(status=UNPUBLISHED).update(status=NEEDS_UPDATE)
        push_key.delay(self)
1010365
function done() {
        var index = queue.length;

        while (index--) {
            patch(queue[index], one(queue[index]));
        }
    }