RailsEventStore / rails_event_store

A Ruby implementation of an Event Store based on Active Record
http://railseventstore.org
MIT License
1.41k stars 121 forks source link

Serializing event types from Dry::Struct events #1454

Closed xhs345 closed 1 year ago

xhs345 commented 1 year ago

Hi, I implemented the event base class in my app on Dry::Struct as shown in some shared tutorials.

One thing I'm not liking about it currently is how objects like Time and Date are serialized when saved by ActiveRecord (e.g. !ruby/object:DateTime 2020-08-07 14:27:32.000000000 -07:00). In my mind it would be better to save them are iso8601 string so they can be consumed platform agnostic and also take up less space, esp when stored in volume.

I saw the guides for custom mappers and serializers in the docs, so I was just wondering if a specific implementation for this issue already existed and if not if there is interest in submitting something.

xhs345 commented 1 year ago

Actually I'll post this under the discussions