There's no need to make a database roundtrip, because all the old attribute
values are available.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>
should_preserve_version = should_preserve_version? # Time sensitive, cache value
return(yield) unless (should_preserve_version || syncable_updates.any?)
- # Put aside the changes because with_lock requires an explicit record reload
+ # Put aside the changes because with_lock does a record reload
changes = self.changes
snapshot = nil
- reload.with_lock do
+ restore_attributes
+ with_lock do
# Copy the original state to save it as old version
if should_preserve_version
snapshot = self.dup
# Environmental secrets are only available for that specific environment.
# development:
-# secret_key_base: rand(1<<255).to_s(36)
+# secret_key_base: <%= rand(1<<255).to_s(36) %>
# test:
-# secret_key_base: rand(1<<255).to_s(36)
+# secret_key_base: <%= rand(1<<255).to_s(36) %>
# In case this doesn't get overriden for some reason, assign a random key
# to gracefully degrade by rejecting cookies instead of by opening a
# vulnerability.
production:
- secret_key_base: rand(1<<255).to_s(36)
+ secret_key_base: <%= rand(1<<255).to_s(36) %>