event_sourced_record 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 572708800666a6ac438befd0004e290e42cde341
|
4
|
+
data.tar.gz: bd813aa2a7f22f68fd9578c4793725c8e990a57f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7dd4787019fa7924f435bf9e62515a77ee3df7f201a13763868296fea317ace10f1bdcc4fe660b49eeaf7254358d6017f5725d76e05bde3cdffa61c34236e02
|
7
|
+
data.tar.gz: 6271f822d88dd64ebc65d0c22800596a5674393354b0110b0e64b17c598f7329c19673dddf6ab1171954ed80b1d95d43667eef85135dfdb9bc37278ad635273c
|
@@ -10,7 +10,8 @@ class EventSourcedRecord::ObserverGenerator < Rails::Generators::NamedBase
|
|
10
10
|
|
11
11
|
def create_application_observer_hook
|
12
12
|
application do
|
13
|
-
|
13
|
+
"config.active_record.observers ||= []
|
14
|
+
config.active_record.observers << :#{file_name}"
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
@@ -16,4 +16,10 @@ class EventSourcedRecord::ObserverGeneratorTest < Rails::Generators::TestCase
|
|
16
16
|
test "creates a file for the observer" do
|
17
17
|
assert_file("app/observers/subscription_event_observer.rb")
|
18
18
|
end
|
19
|
+
|
20
|
+
test "appends to the observer list in application.rb" do
|
21
|
+
assert_file("config/application.rb") do |contents|
|
22
|
+
assert_match(/config.active_record.observers \|\|= \[\]/, contents)
|
23
|
+
end
|
24
|
+
end
|
19
25
|
end
|