lib/jamf/api/mixins/lockable.rb in ruby-jss-1.2.4a2 vs lib/jamf/api/mixins/lockable.rb in ruby-jss-1.2.4a3
- old
+ new
@@ -31,17 +31,25 @@
# When the object is saved, the versionLock is sent back with the data
# and if it doesn't match whats on the server, then the object has been updated
# from elsewhere since we fetched it, and a 409 Conflict error is raised with
# the reason OPTIMISTIC_LOCK_FAILED.
#
- # If that happens, the save doesnt happen, the object is re-fetched,
+ # If that happens, the save doesnt happen, the object must be re-fetched,
# and the user can try again.
#
module Lockable
+ attr_reader :versionLock
+
def initialize(data, cnx: Jamf.cnx)
@versionLock = data[:versionLock]
super
+ end
+
+ def to_jamf
+ data = super
+ data[:versionLock] = @versionLock
+ data
end
end # Lockable
end # Jamf