lib/neo4j/shared/property.rb in neo4j-9.5.3 vs lib/neo4j/shared/property.rb in neo4j-9.6.0
- old
+ new
@@ -9,11 +9,14 @@
class UndefinedPropertyError < Neo4j::Error; end
class MultiparameterAssignmentError < Neo4j::Error; end
attr_reader :_persisted_obj
+ # TODO: Set @attribute correctly using class ActiveModel::Attribute, and after that
+ # remove mutations_from_database and other ActiveModel::Dirty overrided methods
def mutations_from_database
- ActiveModel::NullMutationTracker.instance
+ @mutations_from_database ||=
+ defined?(ActiveModel::ForcedMutationTracker) ? ActiveModel::ForcedMutationTracker.new(self) : ActiveModel::NullMutationTracker.instance
end
def inspect
attribute_descriptions = inspect_attributes.map do |key, value|
"#{Neo4j::ANSI::CYAN}#{key}: #{Neo4j::ANSI::CLEAR}#{value.inspect}"