[ARVADOS] updated: 7cd190acfc0b6ce7f65b3effa1e2ce75ed692a3d

git at public.curoverse.com git at public.curoverse.com
Thu Jun 4 11:45:05 EDT 2015


Summary of changes:
 apps/workbench/app/models/arvados_base.rb     | 12 +++++++-----
 apps/workbench/test/unit/arvados_base_test.rb |  8 +++++++-
 2 files changed, 14 insertions(+), 6 deletions(-)

       via  7cd190acfc0b6ce7f65b3effa1e2ce75ed692a3d (commit)
       via  0d540b1fde91b85db18fa027de65bb67c5389477 (commit)
      from  b193c49962deb916893e1ecb0ab04df8b00e3d7a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7cd190acfc0b6ce7f65b3effa1e2ce75ed692a3d
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Jun 4 11:21:43 2015 -0400

    6087: Fix MissingAttribute check, and change it to a debug warning for now
    because it reveals too many bugs. refs #6087

diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index e7db472..29379a0 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -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
diff --git a/apps/workbench/test/unit/arvados_base_test.rb b/apps/workbench/test/unit/arvados_base_test.rb
index 5b16cd6..e9ac4f8 100644
--- a/apps/workbench/test/unit/arvados_base_test.rb
+++ b/apps/workbench/test/unit/arvados_base_test.rb
@@ -31,7 +31,13 @@ class ArvadosBaseTest < ActiveSupport::TestCase
         filter([['uuid','=',fixture['uuid']]]).
         select(['uuid']).
         first
-      assert_equal nil, c.properties
+      if 'MissingAttribute check is re-enabled' == true
+        assert_raises ActiveModel::MissingAttributeError do
+          c.properties
+        end
+      else
+        assert_equal({}, c.properties)
+      end
 
       got_query = nil
       stub_api_calls

commit 0d540b1fde91b85db18fa027de65bb67c5389477
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Jun 4 10:38:28 2015 -0400

    6087: Fix MissingAttribute firing for new records during changes_applied. refs #6087

diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index c08d747..e7db472 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -79,7 +79,7 @@ class ArvadosBase < ActiveRecord::Base
           unless new_record? or @loaded_attributes.include? k
             raise ActiveModel::MissingAttributeError, "missing attribute: #{k}"
           end
-          super
+          super()
         end
         @attribute_info[k] = coldef
       end
@@ -212,8 +212,8 @@ class ArvadosBase < ActiveRecord::Base
       end
     end
 
-    @new_record = false
     changes_applied
+    @new_record = false
 
     self
   end
@@ -296,8 +296,8 @@ class ArvadosBase < ActiveRecord::Base
       end
     end
     @all_links = nil
-    @new_record = false
     changes_applied
+    @new_record = false
     self
   end
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list