Skip to content

Commit be09d82

Browse files
committed
Fix lazy load hook names and version bump
1 parent 69127f2 commit be09d82

File tree

12 files changed

+139
-101
lines changed

12 files changed

+139
-101
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
### Unreleased
22

3+
### 2.6.2
4+
5+
* Fix lazy load hook names
6+
37
### 2.6.1
48

59
* Handle text/html and application/json responses from Slack #531

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
noticed (2.6.1)
4+
noticed (2.6.2)
55
rails (>= 6.1.0)
66

77
GEM

app/models/noticed/event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ class Event < ApplicationRecord
2525
end
2626
end
2727

28-
ActiveSupport.run_load_hooks :noticed_ephemeral, Noticed::Event
28+
ActiveSupport.run_load_hooks :noticed_event, Noticed::Event

app/models/noticed/notification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ class Notification < ApplicationRecord
1313
end
1414
end
1515

16-
ActiveSupport.run_load_hooks :noticed_ephemeral, Noticed::Notification
16+
ActiveSupport.run_load_hooks :noticed_notification, Noticed::Notification

docs/extending-noticed.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Extending Noticed
2+
3+
Noticed includes lazy load hooks that can be used to extend it's models and functionality.
4+
5+
### Example: Multitenancy
6+
7+
This example adds multitenancy support to Noticed models so they have an `account:belongs_to` association.
8+
9+
```ruby
10+
ActiveSupport.on_load :noticed_event do
11+
belongs_to :account
12+
13+
# Set account association from params
14+
def self.with(params)
15+
account = params.delete(:account) || Current.account
16+
record = params.delete(:record)
17+
18+
# Instantiate Noticed::Event with account:belongs_to
19+
new(account: account, params: params, record: record)
20+
end
21+
22+
def recipient_attributes_for(recipient)
23+
super.merge(account_id: account&.id || recipient.personal_account&.id)
24+
end
25+
end
26+
27+
ActiveSupport.on_load :noticed_notification do
28+
belongs_to :account
29+
delegate :message, to: :event
30+
end
31+
```

gemfiles/rails_6_1.gemfile.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
noticed (2.6.1)
4+
noticed (2.6.2)
55
rails (>= 6.1.0)
66

77
GEM
@@ -83,7 +83,7 @@ GEM
8383
bigdecimal (3.1.9)
8484
builder (3.3.0)
8585
concurrent-ruby (1.3.4)
86-
connection_pool (2.5.2)
86+
connection_pool (2.5.3)
8787
crack (1.0.0)
8888
bigdecimal
8989
rexml
@@ -99,10 +99,10 @@ GEM
9999
net-http (>= 0.5.0)
100100
globalid (1.2.1)
101101
activesupport (>= 6.1)
102-
google-cloud-env (2.2.2)
102+
google-cloud-env (2.3.0)
103103
base64 (~> 0.2)
104104
faraday (>= 1.0, < 3.a)
105-
google-logging-utils (0.1.0)
105+
google-logging-utils (0.2.0)
106106
googleauth (1.14.0)
107107
faraday (>= 1.0, < 3.a)
108108
google-cloud-env (~> 2.2)
@@ -115,13 +115,13 @@ GEM
115115
http-2 (1.1.1)
116116
i18n (1.14.7)
117117
concurrent-ruby (~> 1.0)
118-
json (2.11.3)
118+
json (2.12.0)
119119
jwt (2.10.1)
120120
base64
121-
language_server-protocol (3.17.0.4)
121+
language_server-protocol (3.17.0.5)
122122
lint_roller (1.1.0)
123123
logger (1.7.0)
124-
loofah (2.24.0)
124+
loofah (2.24.1)
125125
crass (~> 1.0.2)
126126
nokogiri (>= 1.12.0)
127127
mail (2.8.1)
@@ -132,15 +132,15 @@ GEM
132132
marcel (1.0.4)
133133
method_source (1.1.0)
134134
mini_mime (1.1.5)
135-
mini_portile2 (2.8.8)
135+
mini_portile2 (2.8.9)
136136
minitest (5.25.5)
137137
multi_json (1.15.0)
138138
mutex_m (0.3.0)
139139
net-http (0.6.0)
140140
uri
141141
net-http2 (0.19.0)
142142
http-2 (>= 1.0)
143-
net-imap (0.5.7)
143+
net-imap (0.5.8)
144144
date
145145
net-protocol
146146
net-pop (0.1.2)
@@ -176,9 +176,9 @@ GEM
176176
racc
177177
pg (1.5.9)
178178
prism (1.4.0)
179-
public_suffix (6.0.1)
179+
public_suffix (6.0.2)
180180
racc (1.8.1)
181-
rack (2.2.13)
181+
rack (2.2.14)
182182
rack-test (2.2.0)
183183
rack (>= 1.3)
184184
rails (6.1.7.10)
@@ -213,7 +213,7 @@ GEM
213213
rake (13.2.1)
214214
regexp_parser (2.10.0)
215215
rexml (3.4.1)
216-
rubocop (1.75.3)
216+
rubocop (1.75.6)
217217
json (~> 2.3)
218218
language_server-protocol (~> 3.17.0.2)
219219
lint_roller (~> 1.1.0)
@@ -232,7 +232,7 @@ GEM
232232
rubocop (>= 1.75.0, < 2.0)
233233
rubocop-ast (>= 1.38.0, < 2.0)
234234
ruby-progressbar (1.13.0)
235-
signet (0.19.0)
235+
signet (0.20.0)
236236
addressable (~> 2.8)
237237
faraday (>= 0.17.5, < 3.a)
238238
jwt (>= 1.5, < 3.0)
@@ -253,10 +253,10 @@ GEM
253253
sqlite3 (1.7.3-x86-linux)
254254
sqlite3 (1.7.3-x86_64-darwin)
255255
sqlite3 (1.7.3-x86_64-linux)
256-
standard (1.49.0)
256+
standard (1.50.0)
257257
language_server-protocol (~> 3.17.0.2)
258258
lint_roller (~> 1.0)
259-
rubocop (~> 1.75.2)
259+
rubocop (~> 1.75.5)
260260
standard-custom (~> 1.0.0)
261261
standard-performance (~> 1.8)
262262
standard-custom (1.0.2)

gemfiles/rails_7_0.gemfile.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
noticed (2.6.1)
4+
noticed (2.6.2)
55
rails (>= 6.1.0)
66

77
GEM
@@ -89,7 +89,7 @@ GEM
8989
bigdecimal (3.1.9)
9090
builder (3.3.0)
9191
concurrent-ruby (1.3.4)
92-
connection_pool (2.5.2)
92+
connection_pool (2.5.3)
9393
crack (1.0.0)
9494
bigdecimal
9595
rexml
@@ -105,10 +105,10 @@ GEM
105105
net-http (>= 0.5.0)
106106
globalid (1.2.1)
107107
activesupport (>= 6.1)
108-
google-cloud-env (2.2.2)
108+
google-cloud-env (2.3.0)
109109
base64 (~> 0.2)
110110
faraday (>= 1.0, < 3.a)
111-
google-logging-utils (0.1.0)
111+
google-logging-utils (0.2.0)
112112
googleauth (1.14.0)
113113
faraday (>= 1.0, < 3.a)
114114
google-cloud-env (~> 2.2)
@@ -121,13 +121,13 @@ GEM
121121
http-2 (1.1.1)
122122
i18n (1.14.7)
123123
concurrent-ruby (~> 1.0)
124-
json (2.11.3)
124+
json (2.12.0)
125125
jwt (2.10.1)
126126
base64
127-
language_server-protocol (3.17.0.4)
127+
language_server-protocol (3.17.0.5)
128128
lint_roller (1.1.0)
129129
logger (1.7.0)
130-
loofah (2.24.0)
130+
loofah (2.24.1)
131131
crass (~> 1.0.2)
132132
nokogiri (>= 1.12.0)
133133
mail (2.8.1)
@@ -138,15 +138,15 @@ GEM
138138
marcel (1.0.4)
139139
method_source (1.1.0)
140140
mini_mime (1.1.5)
141-
mini_portile2 (2.8.8)
141+
mini_portile2 (2.8.9)
142142
minitest (5.25.5)
143143
multi_json (1.15.0)
144144
mutex_m (0.3.0)
145145
net-http (0.6.0)
146146
uri
147147
net-http2 (0.19.0)
148148
http-2 (>= 1.0)
149-
net-imap (0.5.7)
149+
net-imap (0.5.8)
150150
date
151151
net-protocol
152152
net-pop (0.1.2)
@@ -182,9 +182,9 @@ GEM
182182
racc
183183
pg (1.5.9)
184184
prism (1.4.0)
185-
public_suffix (6.0.1)
185+
public_suffix (6.0.2)
186186
racc (1.8.1)
187-
rack (2.2.13)
187+
rack (2.2.14)
188188
rack-test (2.2.0)
189189
rack (>= 1.3)
190190
rails (7.0.8.7)
@@ -219,7 +219,7 @@ GEM
219219
rake (13.2.1)
220220
regexp_parser (2.10.0)
221221
rexml (3.4.1)
222-
rubocop (1.75.3)
222+
rubocop (1.75.6)
223223
json (~> 2.3)
224224
language_server-protocol (~> 3.17.0.2)
225225
lint_roller (~> 1.1.0)
@@ -238,7 +238,7 @@ GEM
238238
rubocop (>= 1.75.0, < 2.0)
239239
rubocop-ast (>= 1.38.0, < 2.0)
240240
ruby-progressbar (1.13.0)
241-
signet (0.19.0)
241+
signet (0.20.0)
242242
addressable (~> 2.8)
243243
faraday (>= 0.17.5, < 3.a)
244244
jwt (>= 1.5, < 3.0)
@@ -251,10 +251,10 @@ GEM
251251
sqlite3 (1.7.3-x86-linux)
252252
sqlite3 (1.7.3-x86_64-darwin)
253253
sqlite3 (1.7.3-x86_64-linux)
254-
standard (1.49.0)
254+
standard (1.50.0)
255255
language_server-protocol (~> 3.17.0.2)
256256
lint_roller (~> 1.0)
257-
rubocop (~> 1.75.2)
257+
rubocop (~> 1.75.5)
258258
standard-custom (~> 1.0.0)
259259
standard-performance (~> 1.8)
260260
standard-custom (1.0.2)

gemfiles/rails_7_1.gemfile.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: ..
33
specs:
4-
noticed (2.6.1)
4+
noticed (2.6.2)
55
rails (>= 6.1.0)
66

77
GEM
@@ -99,7 +99,7 @@ GEM
9999
bigdecimal (3.1.9)
100100
builder (3.3.0)
101101
concurrent-ruby (1.3.5)
102-
connection_pool (2.5.2)
102+
connection_pool (2.5.3)
103103
crack (1.0.0)
104104
bigdecimal
105105
rexml
@@ -115,10 +115,10 @@ GEM
115115
net-http (>= 0.5.0)
116116
globalid (1.2.1)
117117
activesupport (>= 6.1)
118-
google-cloud-env (2.2.2)
118+
google-cloud-env (2.3.0)
119119
base64 (~> 0.2)
120120
faraday (>= 1.0, < 3.a)
121-
google-logging-utils (0.1.0)
121+
google-logging-utils (0.2.0)
122122
googleauth (1.14.0)
123123
faraday (>= 1.0, < 3.a)
124124
google-cloud-env (~> 2.2)
@@ -136,13 +136,13 @@ GEM
136136
pp (>= 0.6.0)
137137
rdoc (>= 4.0.0)
138138
reline (>= 0.4.2)
139-
json (2.11.3)
139+
json (2.12.0)
140140
jwt (2.10.1)
141141
base64
142-
language_server-protocol (3.17.0.4)
142+
language_server-protocol (3.17.0.5)
143143
lint_roller (1.1.0)
144144
logger (1.7.0)
145-
loofah (2.24.0)
145+
loofah (2.24.1)
146146
crass (~> 1.0.2)
147147
nokogiri (>= 1.12.0)
148148
mail (2.8.1)
@@ -152,15 +152,15 @@ GEM
152152
net-smtp
153153
marcel (1.0.4)
154154
mini_mime (1.1.5)
155-
mini_portile2 (2.8.8)
155+
mini_portile2 (2.8.9)
156156
minitest (5.25.5)
157157
multi_json (1.15.0)
158158
mutex_m (0.3.0)
159159
net-http (0.6.0)
160160
uri
161161
net-http2 (0.19.0)
162162
http-2 (>= 1.0)
163-
net-imap (0.5.7)
163+
net-imap (0.5.8)
164164
date
165165
net-protocol
166166
net-pop (0.1.2)
@@ -199,13 +199,13 @@ GEM
199199
prettyprint
200200
prettyprint (0.2.0)
201201
prism (1.4.0)
202-
psych (5.2.3)
202+
psych (5.2.6)
203203
date
204204
stringio
205-
public_suffix (6.0.1)
205+
public_suffix (6.0.2)
206206
racc (1.8.1)
207-
rack (3.1.13)
208-
rack-session (2.1.0)
207+
rack (3.1.14)
208+
rack-session (2.1.1)
209209
base64 (>= 0.1.0)
210210
rack (>= 3.0.0)
211211
rack-test (2.2.0)
@@ -249,7 +249,7 @@ GEM
249249
reline (0.6.1)
250250
io-console (~> 0.5)
251251
rexml (3.4.1)
252-
rubocop (1.75.3)
252+
rubocop (1.75.6)
253253
json (~> 2.3)
254254
language_server-protocol (~> 3.17.0.2)
255255
lint_roller (~> 1.1.0)
@@ -269,7 +269,7 @@ GEM
269269
rubocop-ast (>= 1.38.0, < 2.0)
270270
ruby-progressbar (1.13.0)
271271
securerandom (0.4.1)
272-
signet (0.19.0)
272+
signet (0.20.0)
273273
addressable (~> 2.8)
274274
faraday (>= 0.17.5, < 3.a)
275275
jwt (>= 1.5, < 3.0)
@@ -282,10 +282,10 @@ GEM
282282
sqlite3 (1.7.3-x86-linux)
283283
sqlite3 (1.7.3-x86_64-darwin)
284284
sqlite3 (1.7.3-x86_64-linux)
285-
standard (1.49.0)
285+
standard (1.50.0)
286286
language_server-protocol (~> 3.17.0.2)
287287
lint_roller (~> 1.0)
288-
rubocop (~> 1.75.2)
288+
rubocop (~> 1.75.5)
289289
standard-custom (~> 1.0.0)
290290
standard-performance (~> 1.8)
291291
standard-custom (1.0.2)

0 commit comments

Comments
 (0)