rails_event_store
rails_event_store copied to clipboard
Document multiple databases support
this. Was not able to make it work following instructions from this article. Code:
event_repository = RailsEventStoreActiveRecord::EventRepository.new(
EventStoreBase,
serializer: RubyEventStore::NULL,
)
Error:
Looks like we now have to pass a model_factory to point to another AR base class?
Yep, you are right. The behavior described in blog post has changed in commit https://github.com/RailsEventStore/rails_event_store/commit/8a6e7c30a9b3a76c5565ab2eb48481bfdf9e3b69 (and later other changes).
The valid code now is:
event_repository = RubyEventStore::ActiveRecord::EventRepository.new(
model_factory: RubyEventStore::ActiveRecord::WithAbstractBaseClass.new(EventStoreBase),
serializer: RubyEventStore::NULL,
)