Merge branch '3763-move-collections-error' closes #3763
[arvados.git] / apps / workbench / app / models / arvados_base.rb
index d38ca7822d69998f67d35b5d5c97fb62db015058..083db9133b15cd4e746fbfca982ec6be3805c904 100644 (file)
@@ -167,7 +167,9 @@ class ArvadosBase < ActiveRecord::Base
   def save
     obdata = {}
     self.class.columns.each do |col|
-      obdata[col.name.to_sym] = self.send(col.name.to_sym)
+      unless self.send(col.name.to_sym).nil? and !self.changed.include?(col.name)
+          obdata[col.name.to_sym] = self.send(col.name.to_sym)
+      end
     end
     obdata.delete :id
     postdata = { self.class.to_s.underscore => obdata }
@@ -325,7 +327,7 @@ class ArvadosBase < ActiveRecord::Base
   end
 
   def attribute_editable?(attr, ever=nil)
-    if "created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at".index(attr.to_s)
+    if %w(created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at).include? attr.to_s
       false
     elsif not (current_user.andand.is_active)
       false