Installation with Bundler

By default RailsEventStore will use the Active Record event repository. If you want to use another event repository without loading unecessary Active Record dependency, you'll need to do:

gem 'rails_event_store', require: false
gem 'your_custom_repository'

After running bundle install, Rails Event Store should be ready to be used. See custom repository README to learn how to setup data store.

Require custom repository

You need to require manually rails_event_store gem by doing:

require 'rails_event_store/all'

And then define your custom event repository for RailsEventStore.

RailsEventStore.event_repository = YourCustomRepository::EventRepository.new

This will be used every time you won't pass event repository as an argument to RailsEventStore::Client initializer.

Custom event repositories: