Skip to content

Commit 3b545b0

Browse files
committed
Updates documentation
1 parent 92ee8d2 commit 3b545b0

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
outboxable (1.0.2)
4+
outboxable (1.0.3)
55
bunny (>= 2.19.0)
66
connection_pool (~> 2.3.0)
77

README.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Outboxable
22

3-
The Outboxable Gem is tailored for Rails applications to implement the transactional outbox pattern. It currently only supports ActiveRecord.
3+
The Outboxable Gem is tailored for Rails applications to implement the transactional outbox pattern. It supports both ActiveRecord and Mongoid.
44

55
Please take into consideration that this Gem is **opinionated**, meaning it expects you to follow a certain pattern and specific setting. If you don't like it, you can always fork it and change it.
66

@@ -25,13 +25,19 @@ If bundler is not being used to manage dependencies, install the gem by executin
2525
$ gem install outboxable
2626
```
2727

28-
Then run:
28+
For use with ActiveRecord, run:
2929

3030
```shell
31-
$ rails g outboxable:install
31+
$ rails g outboxable:install --orm activerecord
3232
```
3333

34-
The command above will add a migration file and the Outbox model. You will need then to run the migrations:
34+
For use with Mongoid, run:
35+
36+
```shell
37+
$ rails g outboxable:install --orm mongoid
38+
```
39+
40+
The command above will add a migration file and the Outbox model. You will need then to run the migrations (ActiveRecord only):
3541

3642
```shell
3743
$ rails db:migrate
@@ -64,7 +70,7 @@ module Outboxable
6470
end
6571

6672
Outboxable.configure do |config|
67-
# Specify the ORM you are using. For now, only ActiveRecord is supported.
73+
# Specify the ORM you are using. Supported values are :activerecord and :mongoid
6874
config.orm = :activerecord
6975

7076
# Specify the message broker you are using. For now, only RabbitMQ is supported.
@@ -208,6 +214,12 @@ Last but not least, run sidekiq so that the Outboxable Gem can publish the event
208214
$ bundle exec sidekiq
209215
```
210216

217+
218+
219+
### Mongoid
220+
221+
The Outboxable gem works smoothly with Mongoid. It is to be noted that when used with Mongoid, Outboxable does not use the `_id` as the idempotency key. It creates a field called ``idempotency_key`` which is a UUID generated at the time of the insertion of the document.
222+
211223
## Development
212224

213225
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

lib/outboxable/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Outboxable
4-
VERSION = '1.0.2'
4+
VERSION = '1.0.3'
55
end

lib/templates/activerecord_initializer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def to_envelope(resource:)
2323
# Specify the ORM you are using. For now, only ActiveRecord is supported.
2424
config.orm = :activerecord
2525

26-
# Specify the message broker you are using. For now, only RabbitMQ is supported.
26+
# Specify the ORM you are using. Supported values are :activerecord and :mongoid
2727
config.message_broker = :rabbitmq
2828

2929
# RabbitMQ configurations

lib/templates/mongoid_initializer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def to_envelope(resource:)
2323
# Specify the ORM you are using. For now, only ActiveRecord is supported.
2424
config.orm = :mongoid
2525

26-
# Specify the message broker you are using. For now, only RabbitMQ is supported.
26+
# Specify the ORM you are using. Supported values are :activerecord and :mongoid
2727
config.message_broker = :rabbitmq
2828

2929
# RabbitMQ configurations

0 commit comments

Comments
 (0)