From 4d1508fddbb0c0a5b12ec6449aed275c63cc74e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pacana?= Date: Mon, 30 Jan 2023 11:42:01 +0100 Subject: [PATCH] Revert "Extract to variable" This reverts commit 8d159f50e400594fefefa8593ffde4189cf5eeaa. --- .../lib/ruby_event_store/active_record/event.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ruby_event_store-active_record/lib/ruby_event_store/active_record/event.rb b/ruby_event_store-active_record/lib/ruby_event_store/active_record/event.rb index 22bd4a04fe..2b8b91fd2b 100644 --- a/ruby_event_store-active_record/lib/ruby_event_store/active_record/event.rb +++ b/ruby_event_store-active_record/lib/ruby_event_store/active_record/event.rb @@ -8,10 +8,8 @@ class Event < ::ActiveRecord::Base self.primary_key = :id self.table_name = "event_store_events" - skip_json_serialization = ->(type) { %i[json jsonb].include?(type.type) ? ActiveModel::Type::Value.new : type } - - attribute :data, skip_json_serialization - attribute :metadata, skip_json_serialization + attribute :data, ->(type) { %i[json jsonb].include?(type.type) ? ActiveModel::Type::Value.new : type } + attribute :metadata, ->(type) { %i[json jsonb].include?(type.type) ? ActiveModel::Type::Value.new : type } end private_constant :Event