10078: Now that the recent_collections panel includes collections from Home directory...
[arvados.git] / apps / workbench / app / models / arvados_base.rb
index e7db4728c80486160ae19fdbe259cc7f771960f0..b02db7a6b63b5fad8c75ea5f107baa74a58d7151 100644 (file)
@@ -76,8 +76,10 @@ class ArvadosBase < ActiveRecord::Base
           serialize k, coldef[:type].constantize
         end
         define_method k do
-          unless new_record? or @loaded_attributes.include? k
-            raise ActiveModel::MissingAttributeError, "missing attribute: #{k}"
+          unless new_record? or @loaded_attributes.include? k.to_s
+            Rails.logger.debug "BUG: access non-loaded attribute #{k}"
+            # We should...
+            # raise ActiveModel::MissingAttributeError, "missing attribute: #{k}"
           end
           super()
         end
@@ -355,6 +357,10 @@ class ArvadosBase < ActiveRecord::Base
        (ArvadosBase.find(owner_uuid).writable_by.include? current_user.uuid rescue false)))) or false
   end
 
+  def deletable?
+    editable?
+  end
+
   # Array of strings that are the names of attributes that can be edited
   # with X-Editable.
   def editable_attributes