method

_increment_attribute

Importance_0
v7.1.3.4 - Show latest stable - 0 notes - Class: ActiveRecord::Relation
_increment_attribute(attribute, value = 1) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation.rb, line 948
      def _increment_attribute(attribute, value = 1)
        bind = predicate_builder.build_bind_attribute(attribute.name, value.abs)
        expr = table.coalesce(Arel::Nodes::UnqualifiedColumn.new(attribute), 0)
        expr = value < 0 ? expr - bind : expr + bind
        expr.expr
      end
Register or log in to add new notes.