PUT /saved-searches/:id
769525
def update      
      return if !verify_logged_in
      
      resp = Caboose::StdClass.new({'attributes' => {}})
      search = SavedSearch.find(params[:id])    
      
      save = true
      params.each do |name,value|
        case name
          when 'interval'
            search.interval = value
            resp.attributes['interval'] = { 'text' => "#{value}" }          
  		  end
  		end
  		resp.success = save && search.save  
      render :json => resp
    end
968996
def add
      return if !verify_logged_in      
      
      resp = Caboose::StdClass.new
      
      if SavedSearch.exists?(:uri => params[:uri])
        resp.redirect = "/saved-searches"
      else        
        search = SavedSearch.new(
          :user_id        => logged_in_user.id,
          :date_last      => Date.today,
          :interval       => 1,
          :notify         => true,
          :uri            => params[:uri],
          :property_type  => params[:property_type],
          :params         => params[:params]        
        )
        if search.save
          resp.redirect = "/saved-searches"        
        else
          resp.error = "There was an error saving your search."        
        end
      end
      render :json => resp
    end
936010
def save(self, obj, run_id):
        
        id_code = self.generate_save_identifier(obj, run_id)
        self.store.save(obj, id_code)
817189
def set(id, value, options = {})
      id = Array(id)
      id.push(nil) if id.empty?
      id[id.size - 1] ||= next_id(id[0..-2])
      with_redis do |redis|
        redis.set(redis_key_for(id), dump(value), redis_set_options.merge(options))
      end
      id.last
    end
382558
function (key, value) {
      store[key] = value
      //not urgent, but save this if we are not doing anything.
      dirty[key] = true
      apply_write(key, value)
    }
843685
function setSearch(uri) {
  if (typeof uri.search === 'string' || uri.query === undefined) return;

  if (typeof uri.query === 'string') {
    uri.search = '?' + uri.query;
    return;
  }

  var name, filled = false;
  uri.search = '?';

  for (name in uri.query) {
    filled = true;
    uri.search += name + '=' + uri.query[name] + '&';
  }

  uri.search = uri.search.substr(0, uri.search.length - 1);
}
1284785
def _set_id(self, Id, is_added, index):
        """"""
        if is_added:
            self.selected_ids.add(Id)
        else:
            self.selected_ids.remove(Id)
        self.dataChanged.emit(index, index)
370614
def _hook_id(self, info):
        
        if isinstance(info, dict) and 'id' in info.keys():
            self.id = info['id']
954555
function changeId(content, filePath, name, idSep) {
    if (idSep === void 0) { idSep = '_'; }
    var idReg = /svgicon(\w+)/g;
    content = content.replace(idReg, function (match, elId) {
        return "svgicon" + idSep + filePath.replace(/[\\\/]/g, idSep) + name + idSep + elId;
    });
    return content;
}
319164
function save()
    {
        if ($this->id != false || $this->id != 0) {
            return $this->update();
        } else {
            return $this->insert();
        }
    }
707459
function save(storage, name, value) {
        var key = '$BD$' + name;
        if (value === null) value = '';
        storage[key] = value;
      }
524937
function( key ) {

		var savedRoomId = keyToId[ key ];

		if( savedRoomId ) {

			return promise.resolve( savedRoomId );
		} else {

			return promise.reject();
		}
	}
1125949
def put_object(obj, id)
      find_blob(id, true).write_object(id, serialize(obj))
    end
65778
def id_exists(api, search_id):
    
    response = utils.checked_api_call(api, 'get_specific', id=search_id)
    return response is not None
1005487
def delete
      return if !verify_logged_in
      
      resp = Caboose::StdClass.new               
      search = SavedSearch.find(params[:id])
      
      if search
        search.destroy
        resp.success = "The saved search has been deleted."                
      else
        resp.error = "There was an error deleting your search."        
      end
      
      render :json => resp
    end
1304444
def save(self, inplace=True):
        
        data = self._modified_data()
        data = data['permissions']
        if bool(data):
            url = six.text_type(self.href) + self._URL['permissions']
            extra = {'resource': self.__class__.__name__, 'query': data}
            logger.info('Modifying permissions', extra=extra)
            self._api.patch(url=url, data=data, append_base=False)
        else:
            raise ResourceNotModified()
1121855
function (id, callback) {
        var todos = data.todos;

        for (var i = 0; i < todos.length; i++) {
          if (todos[i].id == id) {
            todos.splice(i, 1);
            break;
          }
        }

        flush();
        callback.call(undefined, data.todos);
      }