@@ -286,21 +286,23 @@ module ActiveRecord
286
286
specify "JSON/B backwards compatibility — explicit NULL serializer as advised before introduction of JSONClient" do
287
287
skip unless %w[ json jsonb ] . include? ( ENV [ "DATA_TYPE" ] )
288
288
289
- expect { repository = EventRepository . new ( serializer : NULL ) } . to output ( <<~MSG ) . to_stderr
290
- The data or metadata column is of a JSON/B type and expects a JSON string.
289
+ expect { EventRepository . new ( serializer : NULL ) } . not_to output . to_stderr
291
290
292
- Yet the repository serializer is configured as RubyEventStore:: NULL and it would not
293
- produce the expected JSON string.
291
+ expect { repository = EventRepository . new ( serializer : NULL ) . has_event? ( SecureRandom . uuid ) } . to output ( <<~MSG ) . to_stderr
292
+ The data or metadata column is of a JSON/B type and expects a JSON string.
294
293
295
- In ActiveRecord there's an implicit serialization to JSON for JSON/B column types
296
- that made it work so far. This behaviour is unfortunately also a source of undesired
294
+ Yet the repository serializer is configured as RubyEventStore::NULL and it would not
295
+ produce the expected JSON string.
296
+
297
+ In ActiveRecord there's an implicit serialization to JSON for JSON/B column types
298
+ that made it work so far. This behaviour is unfortunately also a source of undesired
297
299
double serialization — first in the EventRepository, second in the ActiveRecord.
298
-
299
- In the past we've advised workarounds that introduced configuration incosistency
300
- with other data types and serialization formats, i.e. explicitly passing NULL serializer
300
+
301
+ In the past we've advised workarounds that introduced configuration incosistency
302
+ with other data types and serialization formats, i.e. explicitly passing NULL serializer
301
303
just for the JSON/B data types.
302
304
303
- As of now this special ActiveRecord behaviour is disabled. You should be using JSON
305
+ As of now this special ActiveRecord behaviour is disabled. You should be using JSON
304
306
serializer back again:
305
307
306
308
RubyEventStore::ActiveRecord::EventRepository.new(serializer: JSON)
0 commit comments