jera_push 1.2.3 → 1.2.4
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6f63d90cf49a65d29029d1c6597afb8e813537a7b60ed9b045a885eb1799f81
|
4
|
+
data.tar.gz: 57af32466be12fbc0828920abc1f556b9351452f491e4981cf54a93a1dda060e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bfd9f73d69b6650e536549022c378eb34404ff494ff71d718974af27236f3b0cfe56107c130b6149485398675b86b47cc02815e3a0cb487691c86ca0d99b2b9
|
7
|
+
data.tar.gz: 7c6c7e81a5efb2eff4de42167b54d55953d8ac8522e0a74628146b911c6a5cb2de2dbe38df5e13b03d182a7b2df8ada0874c55f89cb8389259f8b8180bc8119a
|
@@ -28,7 +28,7 @@ module JeraPush
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def create
|
31
|
-
push_message = JeraPush::Service::SendMessage.new(
|
31
|
+
push_message = JeraPush::Service::SendMessage.new(message_params).call
|
32
32
|
|
33
33
|
if push_message
|
34
34
|
flash[:notice] = t('jera_push.admin.messages.new.toast.success')
|
@@ -48,6 +48,10 @@ module JeraPush
|
|
48
48
|
@message_devices = JeraPush::MessageDevice.includes(:device).where('message_id = :id and device_id in (:device_ids)', id: params[:id], device_ids: @devices.pluck(:id))
|
49
49
|
end
|
50
50
|
|
51
|
+
def message_params
|
52
|
+
params.permit(:type, devices: [], message: [:key, :value])
|
53
|
+
end
|
54
|
+
|
51
55
|
def device_filter_params
|
52
56
|
params.permit(:value, :field, :resource_name, platform: []).merge({ message_id: params[:id] })
|
53
57
|
end
|
@@ -3,15 +3,16 @@ module JeraPush
|
|
3
3
|
class SendMessage
|
4
4
|
|
5
5
|
def initialize(*args)
|
6
|
-
args[
|
6
|
+
@type = args.first[:type].to_sym
|
7
|
+
@message = args.first[:message]
|
8
|
+
@devices = args.first[:devices]
|
7
9
|
end
|
8
10
|
|
9
11
|
def call
|
10
12
|
return false unless valid?
|
11
13
|
|
12
14
|
message_content = JeraPush::Message.format_hash @message
|
13
|
-
|
14
|
-
case @type.to_sym
|
15
|
+
case @type
|
15
16
|
when :broadcast
|
16
17
|
JeraPush::Message.send_broadcast(content: message_content)
|
17
18
|
when :specific
|
data/lib/jera_push/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jera_push
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jera
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|