16470: Fixes test failures caused by a change on ActiveModel::Dirty.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Thu, 13 Aug 2020 18:01:42 +0000 (15:01 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 24 Aug 2020 15:21:28 +0000 (12:21 -0300)
This was a tough one to diagnose. The Dirty module introduced the usage of an
attribute mutation tracker, being disabled here for functional tests to start
working again.
This commit is based on: https://github.com/Dynamoid/dynamoid/pull/256

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

apps/workbench/app/models/arvados_base.rb

index b9162c2aec364bd03a34171c9981262304bc9d06..c5e1a4ed2240075691fd6e03827c746be950f3aa 100644 (file)
@@ -106,6 +106,12 @@ class ArvadosBase
     end
   end
 
+  # The ActiveModel::Dirty API was changed on Rails 5.2
+  # See: https://github.com/rails/rails/commit/c3675f50d2e59b7fc173d7b332860c4b1a24a726#diff-aaddd42c7feb0834b1b5c66af69814d3
+  def mutations_from_database
+    @mutations_from_database ||= ActiveModel::NullMutationTracker.instance
+  end
+
   def self.columns
     @discovered_columns = [] if !defined?(@discovered_columns)
     return @discovered_columns if @discovered_columns.andand.any?