thecore_backend_commons 3.1.0 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/concern_application_record.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d36b1d264e07258e473fd2cf61f416b13c1f90f824df789caf1fa59a2256a10
|
4
|
+
data.tar.gz: 1555f66225ca9351fb662200e2e1aae8316db72d3860efcb84e8f462df61d7df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d360689783298699ad923937becd16bd2196d6c11ed003ada2ecba3d2da057d5738eed9f09afede7f12db4cce7bc9c8c0fa4f538b76d6aff52086754c1d84326
|
7
|
+
data.tar.gz: aa70cf87907c29a39e526f688c5f92c0fe4d1e1c9972fd8f246ac713085e904443f0962f3fcc77a47cf581e353bd135c175c268426ca8fc7c1ddf592d2a685cb
|
@@ -3,16 +3,22 @@ require 'active_support/concern'
|
|
3
3
|
module ApplicationRecordConcern
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
included do
|
6
|
+
after_validation :validation_ko
|
7
|
+
|
6
8
|
after_commit :message_ok
|
7
9
|
|
8
10
|
after_rollback :message_ko
|
9
11
|
|
12
|
+
def validation_ko
|
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
|
+
end
|
15
|
+
|
10
16
|
def message_ok
|
11
|
-
ActionCable.server.broadcast("messages", { topic: :record, action: detect_action, success: true, record: self})
|
17
|
+
ActionCable.server.broadcast("messages", { topic: :record, action: detect_action, success: true, valid: true, errors: [], record: self})
|
12
18
|
end
|
13
19
|
|
14
20
|
def message_ko
|
15
|
-
ActionCable.server.broadcast("messages", { topic: :record, action: detect_action, success: false, record: self})
|
21
|
+
ActionCable.server.broadcast("messages", { topic: :record, action: detect_action, success: false, valid: true, errors: [], record: self})
|
16
22
|
end
|
17
23
|
|
18
24
|
def detect_action
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_backend_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_auth_commons
|