Skip to content

Commit 0e61b61

Browse files
committed
Add documentation for enabling multiple observers in README
1 parent 3a7a627 commit 0e61b61

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ the observer's `before_destroy` is called.
7979

8080
For an observer to be active, it must be registered first. This can be done by adding the following line into the `application.rb`:
8181

82+
```
8283
config.active_record.observers = :contact_observer
84+
```
85+
86+
Enable multiple observers using array:
87+
88+
```
89+
config.active_record.observers = [:contact_observer, :user_observer]
90+
```
8391

8492
Observers can also be registered on an environment-specific basis by simply using the corresponding environment's configuration file instead of `application.rb`.
8593

0 commit comments

Comments
 (0)