thecore_backend_commons 3.1.1 → 3.1.3

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: 02e0dc0a4db400d2e673834351ca1e026b57404bc065277084520156a0ee7929
4
- data.tar.gz: ab4b18f01d368505765cc48581e502ae348693fe8a8818f62fc7f4016611c4e4
3
+ metadata.gz: cb20c15ff661ae29da36dd49e741a06f2fcebfe66d6d396ab8d13e56bc19cfaf
4
+ data.tar.gz: 0eb50b593ab125d7ea382429cd8c5239bff1bdcbecf374684696afe07decc2b4
5
5
  SHA512:
6
- metadata.gz: 0056a8bd4b9a0d4912f835c64f571e90071f5f1eabd9d336cfcbab2c1459748d8e2ff13f14bd6eb24aa89c4644dc33c54339226e87dbfebe4226df359a92749a
7
- data.tar.gz: 9a8d6d01ca0a2b679da6a586f23379fdcc6db490f3a1fa1d87c51bbe332018699e8441f2df67fba6774a7fc5186542bf88dfe800e393a85185769db115bb7c32
6
+ metadata.gz: 11f14abba150e961335fc6ba119606c2e4fed084294fbc0896f31069441eced1310dfa1c243e1638375b7afe8c38e75ddf1e0b5036df2378f51ab5c5e7e9a176
7
+ data.tar.gz: 546044d1eef76e68c3542cc4fc23692259e527e5e3dc544912f1d95e12bee58bbcca58eea668fe22491ce74da6e4d8e29bfbe89afda71c053ee0b764a382d758
@@ -7,10 +7,7 @@ class ActivityLogChannel < ApplicationCable::Channel
7
7
  # Any cleanup needed when channel is unsubscribed
8
8
  end
9
9
 
10
- # https://cableready.stimulusreflex.com/troubleshooting/#verify-actioncable
11
-
12
10
  def receive(data)
13
- puts data["message"]
14
- ActionCable.server.broadcast("messages", "ActionCable is connected")
11
+ ActionCable.server.broadcast("messages", {message: "ActionCable is connected and received: #{data["message"]}", topic: data["topic"].presence || "general"}) if data["namespace"] == "subscriptions"
15
12
  end
16
13
  end
@@ -1,2 +1,3 @@
1
1
  Rails.application.config.active_storage.configure :Disk, root: Rails.root.join("storage")
2
2
  Rails.application.config.action_mailer.delivery_method = :smtp
3
+ Rails.application.config.action_cable.allowed_request_origins = [ ENV["FRONTEND_URL"].presence || /http:\/\/*/, ENV["BACKEND_URL"].presence || /http:\/\/*/ ].uniq
@@ -10,7 +10,7 @@ module ApplicationRecordConcern
10
10
  after_rollback :message_ko
11
11
 
12
12
  def validation_ko
13
- ActionCable.server.broadcast("messages", { topic: :record, action: detect_action, success: false, valid: false, errors: self.errors.full_messages, record: self}) if self.errors.any?
13
+ ActionCable.server.broadcast("messages", { topic: :record, action: detect_action, success: false, valid: false, errors: self.errors.full_messages.uniq, record: self}) if self.errors.any?
14
14
  end
15
15
 
16
16
  def message_ok
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.1.1
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni