active_outbox 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/generators/active_outbox/templates/migration.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fad444e8c23086a1afdf59fe196c7a866b7c70460013de5e6b686643851b6ce8
|
4
|
+
data.tar.gz: 0be6703e8c5522ed853e59fe91b6bd4636c4ea7e819726955b67e84ed95eba93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06bbf4b9548f6e1f1dd1e8eb7e66269a7bb696350a9eda5baafd4abb1cb0c8b3982062107dc62ae9a65a92f6b99578eebbed8f3beb63bacaab8ac924602a7972
|
7
|
+
data.tar.gz: d37e3a4a6f447fc2fa48d34efe65eaebc25e1d4269d4f149e0b9d9ba8a01db4a797532df28b0cdbac8eb864e30cb03bcc581277df40278e6f4cf2916bd70bf7a
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Active Outbox
|
2
|
-
A Transactional Outbox implementation for ActiveRecord
|
2
|
+
A Transactional Outbox implementation for Rails and ActiveRecord.
|
3
3
|
|
4
4
|
![transactional outbox pattern](./docs/images/transactional_outbox.png)
|
5
5
|
|
@@ -37,13 +37,13 @@ gem install active_outbox
|
|
37
37
|
|
38
38
|
## Usage
|
39
39
|
### Setup
|
40
|
-
Create an `
|
40
|
+
Create an initializer under `config/initializers/active_outbox.rb` and setup the default outbox class to the new `Outbox` model you just created.
|
41
41
|
```bash
|
42
|
-
rails g active_outbox:
|
42
|
+
rails g active_outbox:install
|
43
43
|
```
|
44
|
-
After
|
44
|
+
After creating the initializer, create an `Outbox` table using the provided generator and corresponding model. Any model name can be passed as an argument but if empty it will default to just `Outobx`. The generated table name will be `model_name_outboxes`.
|
45
45
|
```bash
|
46
|
-
rails g active_outbox:
|
46
|
+
rails g active_outbox:model <optional model_name>
|
47
47
|
```
|
48
48
|
|
49
49
|
To allow models to store Outbox records on changes, you will have to include the `Outboxable` concern.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class ActiveOutboxCreate<%= table_name.camelize
|
3
|
+
class ActiveOutboxCreate<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
|
4
4
|
def change
|
5
5
|
create_table :<%= table_name %> do |t|
|
6
6
|
t.<%= ActiveOutbox::AdapterHelper.uuid_type %> :identifier, null: false, index: { unique: true }
|