Flag an attribute as going to change.

 @example Flag the attribute.
   model.attribute_will_change!("name")

 @param [ String ] attr The name of the attribute.

 @return [ Object ] The old value.

 @since 2.3.0
428805
def attribute_will_change!(attr)
      unless changed_attributes.key?(attr)
        changed_attributes[attr] = read_raw_attribute(attr).__deep_copy__
      end
    end
385460
def update(self, data_=None, **kwargs):
    
    if data_ is None:
      data_ = dict()
    else:
      data_ = dict(data_)
    data_.update(**kwargs)
    changes = set()
    for attr_name in data_:
      if hasattr(self, attr_name):
        if getattr(self, attr_name) != data_[attr_name]:
          changes.add(attr_name)
          setattr(self, attr_name, data_[attr_name])
      else:
        if self.strict_attrs:
          raise Exception("Unknown attribute for {}: {}".format(self.__class__.__name__, attr_name))
    return changes
213891
function(attr) {
      var startIndex, newAttr,
        i = 0,
        hasEndBracket = true;
      startIndex = attr.indexOf('[', i);
      if (startIndex < 0) {
        return attr;
      }
      newAttr = attr.substring(0, startIndex + 1);
      while (startIndex > 0 && hasEndBracket) {
         i = attr.indexOf(']', i) + 1;
         hasEndBracket = i > 0;
         startIndex = attr.indexOf('[', i);
         if (startIndex > 0) {
           newAttr = newAttr + attr.substring(i - 1, startIndex + 1);
         }
      }
      newAttr = newAttr + attr.substring(i - 1);
      return newAttr;
    }
1077272
def remove_attr(self, attr_name):
		
		if self.__ro_flag:
			raise RuntimeError('Read-only cookie changing attempt')
		name = self.__attr_name(attr_name)
		if name in self.__attrs.keys():
			self.__attrs.pop(attr_name)
123214
def attribute_changed(self):
        

        for model in umbra.ui.models.GraphModel.find_model(self):
            headers = model.horizontal_headers.values()
            if not self.name in headers:
                continue

            model.attribute_changed(model.find_node(self), headers.index(self.name))
        return True
193754
function(value, attr) {
          if (!self._pending[attr] && !self._silent[attr]) {
            delete self.changed[attr];
          }
        }
879868
def attribute(*args)
      if args.first.is_a?(Hash)
        args.first.each_pair do |key, name|
          @attributes.add(name: name, attr: key)
        end
      else
        options = args.extract_options!
        args.each do |name|
          key = options[:as] || name
          @attributes.add(name: name, attr: key)
        end
      end
    end
715914
def __compat_set_attribute_was(name, previous)
      if respond_to?(:set_attribute_was, true)
        # Rails 4.2+
        set_attribute_was(name, previous)
      else
        # Rails < 4.2
        changed_attributes[name] = previous
      end
    end
423093
def on_html_attr(name, value)
      if value[0] == :slim && value[1] == :attrvalue && !options[:merge_attrs][name]
        # We handle the attribute as a boolean attribute
        escape, code = value[2], value[3]
        case code
        when 'true'
          [:html, :attr, name, [:multi]]
        when 'false', 'nil'
          [:multi]
        else
          tmp = unique_name
          [:multi,
           [:code, "#{tmp} = #{code}"],
           [:if, tmp,
            [:if, "#{tmp} == true",
             [:html, :attr, name, [:multi]],
             [:html, :attr, name, [:escape, escape, [:dynamic, tmp]]]]]]
        end
      else
        # Attribute with merging
        @attr = name
        super
      end
    end
334973
def attribute_present?(name)
      attribute = read_raw_attribute(name)
      !attribute.blank? || attribute == false
    rescue ActiveModel::MissingAttributeError
      false
    end
316917
def attribute?(attr)
      return false unless container.key?(key_as_sym(attr))
      ![ "", " ", nil, [],[""], [" "], self.class.new({}), [[]]].any? {|a| a == container[key_as_sym(attr)] }
    end
1187754
def update_attribute(key, value)
      unless attribute?(key.to_sym)
        raise Error::UnknownAttribute.new(attribute: key)
      end

      _attributes[key.to_sym] = value
    end
819410
function(attr) {
        if (!arguments.length) {
          return !_.isEmpty(this.changed);
        }
        return this.changed && _.has(this.changed, attr);
      }
301382
def action_attr(attr_name):
    

    def action_attr(value, context, **_params):
        setattr(context["action"], attr_name, value)
        return _attr()

    return action_attr
1028205
function(attr) {
      if (!this._hasComputed) this._computeChanges();
      if (attr == null) return !_.isEmpty(this.changed);
      return _.has(this.changed, attr);
    }
671945
def assign_all_attributes(attrs, track_changes = false)
      # Assign each attribute using setters
      attrs.each_pair do |key, value|
        key = key.to_sym

        # Track the change, since assign_all_attributes runs with no_change_tracking
        old_val = @attributes[key]
        attribute_will_change!(key, old_val) if track_changes && old_val != value

        if self.respond_to?(:"#{key}=")
          # If a method without an underscore is defined, call that.
          send(:"#{key}=", value)
        else
          # Otherwise, use the _ version
          set(key, value)
        end
      end

      # Make an id if there isn't one yet
      if @attributes[:id].nil? && persistor.try(:auto_generate_id)
        @attributes[:id] = generate_id
      end
    end
431038
def set(attribute_name, value, &block)
      # Assign, without the =
      attribute_name = attribute_name.to_sym

      check_valid_field_name(attribute_name)

      old_value = @attributes[attribute_name]
      new_value = wrap_value(value, [attribute_name])

      if old_value != new_value
        # Track the old value, skip if we are in no_validate
        attribute_will_change!(attribute_name, old_value) unless Volt.in_mode?(:no_change_tracking)

        # Assign the new value
        @attributes[attribute_name] = new_value

        @deps.changed!(attribute_name)

        @size_dep.changed! if old_value.nil? || new_value.nil?

        # TODO: Can we make this so it doesn't need to be handled for non store collections
        # (maybe move it to persistor, though thats weird since buffers don't have a persistor)
        clear_server_errors(attribute_name) if @server_errors.present?

        # Save the changes
        run_changed(attribute_name) unless Volt.in_mode?(:no_change_tracking)
      end

      new_value
    end