instance method changed_in_place?

Ruby on Rails 7.1.6

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

changed_in_place?(raw_old_value, new_value)

Determines whether the mutable value has been modified since it was read. Returns false by default. If your type returns an object which could be mutated, you should override this method. You will need to either:

  • pass new_value to Value#serialize and compare it to raw_old_value

or

  • pass raw_old_value to Value#deserialize and compare it to new_value

raw_old_value The original value, before being passed to deserialize.

new_value The current value, after type casting.

Parameters

raw_old_value req
new_value req
Source
# File activemodel/lib/active_model/type/value.rb, line 105
      def changed_in_place?(raw_old_value, new_value)
        false
      end

Defined in activemodel/lib/active_model/type/value.rb line 105 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::Type::Value

Type at least 2 characters to search.

↑↓ navigate · open · esc close