Review comments:
1. How about the method name "has_symbols?" instead of "has_any_symbols?"
2. convert_serialized_symbols_to_strings method
This method checks "if attr.object_class == Hash"
Even though we have used only Hash type objects for serialized attributes, can't I have an array defined as seriazed attribute? For ex: "serialize :my_attr, Array"
Should this method hence also support Array objects as well? What if I said "serialize :my_attr, String" or some other db supported object?
Should this method intead omit this check and invoke "if self.class.has_any_symbols? attributes[colname]" for all cases or all supported cases?
3. Please add the below additional tests to ArvadosModelTest -> test "refuse symbol keys in serialized attribute: #{x.inspect}"
--- a/services/api/test/unit/arvados_model_test.rb
+++ b/services/api/test/unit/arvados_model_test.rb
@ -32,6 +32,12
@ class ArvadosModelTest < ActiveSupport::TestCase
[ {:a => 'foo'},
+ {'a' => :foo},
+ {:a => ['foo', 'bar']},
+ {'a' => [:foo, 'bar']},
+ {:a => [:foo, :bar]},
+ {:a => {'foo' => {'bar' => 'baz'}}},
+ {'a' => {:foo => {'bar' => 'baz'}}},
{'a' => {'foo' => {:bar => 'baz'}}},
{'a' => {'foo' => {'bar' => :baz}}},