rails_event_store icon indicating copy to clipboard operation
rails_event_store copied to clipboard

Document multiple databases support

Open mostlyobvious opened this issue 5 years ago • 2 comments

mostlyobvious avatar Dec 30 '20 13:12 mostlyobvious

this. Was not able to make it work following instructions from this article. Code:

event_repository = RailsEventStoreActiveRecord::EventRepository.new(
    EventStoreBase, 
    serializer: RubyEventStore::NULL,
  )

Error: Screenshot 2023-06-01 at 1 58 20 PM

Looks like we now have to pass a model_factory to point to another AR base class?

mzanini avatar Jun 01 '23 20:06 mzanini

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,
  )

mpraglowski avatar Jun 07 '23 07:06 mpraglowski