thecore_backend_commons 3.3.3 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47f357e5a5b355623f7eaa5443e8ba8cfb5566311f6c5f866cbda9740a48a044
|
|
4
|
+
data.tar.gz: 52725ea116ba712bc9c68b4c3b757c2a64a7b1270b2efd1f56cd16c503d21bbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fbb02e11840fdd2608ce289285424c5792e50ce09ef207c08a4aafd943761e01f2ed72e50bbe855c0fb8d35e61bb6e24c0ee170d335d26f19f8645b00b918d1e
|
|
7
|
+
data.tar.gz: cfbcd1ecdfb625c4eaa3119a64394afb73806f5c764b3c7982a44432aee24143de465ec268a60ed927714abf0702190e751401377d703dbe4226cc4bd49ac2b8
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
class PushDispatchJob < ApplicationJob
|
|
2
|
+
queue_as :"#{ENV.fetch('COMPOSE_PROJECT_NAME', 'default')}_default"
|
|
3
|
+
|
|
4
|
+
def perform(push_message_id)
|
|
5
|
+
message = PushMessage.find_by(id: push_message_id)
|
|
6
|
+
return unless message
|
|
7
|
+
|
|
8
|
+
ThecoreBackendCommons::PushNotificationService.dispatch(message.push_subscriber, message)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# config.to_prepare do
|
|
2
|
+
# User.class_eval do
|
|
3
|
+
# has_many :push_subscribers, dependent: :destroy
|
|
4
|
+
# end
|
|
5
|
+
# end
|
|
6
|
+
|
|
7
|
+
module ThecoreBackendCommonsUserConcern
|
|
8
|
+
extend ActiveSupport::Concern
|
|
9
|
+
|
|
10
|
+
included do
|
|
11
|
+
has_many :push_subscribers, dependent: :destroy
|
|
12
|
+
has_many :sent_push_messages, class_name: "PushMessage", foreign_key: :sender_user_id, dependent: :destroy
|
|
13
|
+
end
|
|
14
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thecore_backend_commons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriele Tassoni
|
|
@@ -203,6 +203,7 @@ files:
|
|
|
203
203
|
- Rakefile
|
|
204
204
|
- app/channels/activity_log_channel.rb
|
|
205
205
|
- app/channels/push_notification_channel.rb
|
|
206
|
+
- app/jobs/push_dispatch_job.rb
|
|
206
207
|
- app/mailers/concerns/smtp_deliverable.rb
|
|
207
208
|
- app/models/push_message.rb
|
|
208
209
|
- app/models/push_subscriber.rb
|
|
@@ -214,6 +215,7 @@ files:
|
|
|
214
215
|
- config/initializers/concern_cable_connection.rb
|
|
215
216
|
- config/initializers/concern_integer.rb
|
|
216
217
|
- config/initializers/concern_string.rb
|
|
218
|
+
- config/initializers/concern_user.rb
|
|
217
219
|
- config/initializers/extension_nil.rb
|
|
218
220
|
- config/initializers/extension_string.rb
|
|
219
221
|
- config/locales/en.devise.custom.yml
|