lib/neo4j/shared/persistence.rb in neo4j-5.2.12 vs lib/neo4j/shared/persistence.rb in neo4j-5.2.13
- old
+ new
@@ -81,11 +81,11 @@
self.send("#{key}=", value) if self.send(key).nil?
end
end
def touch
- fail "Cannot touch on a new record object" unless persisted?
- update_attribute(:updated_at, Time.now) if attributes.key?('updated_at')
+ fail 'Cannot touch on a new record object' unless persisted?
+ update_attribute!(:updated_at, Time.now) if respond_to?(:updated_at=)
end
# Returns +true+ if the record is persisted, i.e. it's not a new record and it was not destroyed
def persisted?
!new_record? && !destroyed?