From: Tom Clegg Date: Sat, 9 Feb 2013 08:16:07 +0000 (-0500) Subject: set modified_by_user=nil instead of breaking if no user is logged in X-Git-Tag: 1.1.0~3437 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/25acaec8d0b9deabeb963698d0f2503f92dde54c?hp=3c223e3b0d2deef5afe28564ad610cb0db7d4cc1 set modified_by_user=nil instead of breaking if no user is logged in --- diff --git a/app/models/orvos_model.rb b/app/models/orvos_model.rb index f9bc59d2be..6feb891084 100644 --- a/app/models/orvos_model.rb +++ b/app/models/orvos_model.rb @@ -82,9 +82,9 @@ class OrvosModel < ActiveRecord::Base def update_modified_by_fields self.created_at ||= Time.now - self.owner ||= current_user.uuid + self.owner ||= current_user.uuid if current_user self.modified_at = Time.now - self.modified_by_user = current_user.uuid + self.modified_by_user = current_user ? current_user.uuid : nil self.modified_by_client = current_api_client ? current_api_client.uuid : nil end end