thecore_backend_commons 3.6.0 → 3.8.0
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: 87cd88199c064c66426aa326171b69d52fb1833e3e9cabf5cfb8856f9193a151
|
|
4
|
+
data.tar.gz: 9564c73bdf8b9167d6a6116a9c86290dbdf9a032af5f770d2f14a5800b213ba0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: adde92df4fa407e41ce14f125eb1a97392cd73c4509f221f2a68064a9078fb72b07bd3e1c0676d9404d6727500b41002c76320de9a3ea900065cb0377ed88537
|
|
7
|
+
data.tar.gz: 92d69794ef610e4e9dc402bb87c331e82400812d51660f7f2c60c604422c54fec0ccb881bc20e3547ff58fac5643a6282809b896baf1159531a3b9f0e178ae62
|
|
@@ -24,7 +24,7 @@ module TimeZoneAware
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
cattr_accessor :json_attrs unless respond_to?(:json_attrs)
|
|
27
|
-
self.json_attrs = ::
|
|
27
|
+
self.json_attrs = ::ThecoreBackendCommons.smart_merge(json_attrs || {}, {
|
|
28
28
|
methods: [:"#{field}_server_tz", :"#{field}_record_tz"],
|
|
29
29
|
})
|
|
30
30
|
end
|
|
@@ -7,3 +7,11 @@ Rails.application.config.active_storage.routes_prefix = ENV.fetch("RAILS_RELATIV
|
|
|
7
7
|
Rails.application.config.action_mailer.delivery_method = :smtp
|
|
8
8
|
|
|
9
9
|
Rails.application.config.action_cable.allowed_request_origins = [/http:\/\/*/, /https:\/\/*/, /file:\/\/*/, 'file://', nil]
|
|
10
|
+
|
|
11
|
+
# Every Thecore app ships a dedicated Sidekiq worker service alongside the web backend (see
|
|
12
|
+
# thecore_devcontainer's docker-compose.yml) — this gem already hard-requires the sidekiq gems
|
|
13
|
+
# and mounts Sidekiq::Web unconditionally (thecore_background_jobs), so ActiveJob should actually
|
|
14
|
+
# route through it rather than defaulting to Rails' in-process :async, which silently drops any
|
|
15
|
+
# job in flight when its process restarts. Production only: :async remains the default in
|
|
16
|
+
# development/test so neither requires a reachable Redis. See docs/adr/0001, CONTEXT.md.
|
|
17
|
+
Rails.application.config.active_job.queue_adapter = :sidekiq if Rails.env.production?
|
|
@@ -21,7 +21,7 @@ module BaseApplicationRecordConcern
|
|
|
21
21
|
after_rollback :message_ko
|
|
22
22
|
|
|
23
23
|
cattr_accessor :json_attrs
|
|
24
|
-
self.json_attrs = ::
|
|
24
|
+
self.json_attrs = ::ThecoreBackendCommons.smart_merge (json_attrs || {}), {
|
|
25
25
|
methods: [:assets_paths, :rich_content_html],
|
|
26
26
|
}
|
|
27
27
|
end
|
|
@@ -11,6 +11,7 @@ require "active_storage_validations"
|
|
|
11
11
|
require "ulid"
|
|
12
12
|
require "csv"
|
|
13
13
|
require "seed_dump"
|
|
14
|
+
require "deep_merge/rails_compat"
|
|
14
15
|
|
|
15
16
|
require "thecore_backend_commons/version"
|
|
16
17
|
require "thecore_backend_commons/engine"
|
|
@@ -20,4 +21,14 @@ require "thecore_backend_commons/push_notification_service"
|
|
|
20
21
|
require "thecore_backend_commons/default_module_registry"
|
|
21
22
|
|
|
22
23
|
module ThecoreBackendCommons
|
|
24
|
+
# Deep-merges +dest+ into +src+ (mutating and returning +src+), extending existing arrays
|
|
25
|
+
# instead of replacing them — the way json_attrs are composed across concerns.
|
|
26
|
+
# Lives here, not in model_driven_api: model_driven_api depends on this gem, so this gem's own
|
|
27
|
+
# TimeZoneAware / BaseApplicationRecordConcern (and gems built on it) calling
|
|
28
|
+
# ::ModelDrivenApi.smart_merge crashed with NameError in any app without model_driven_api.
|
|
29
|
+
# ModelDrivenApi.smart_merge now delegates here.
|
|
30
|
+
def self.smart_merge(src, dest)
|
|
31
|
+
src.deeper_merge!(dest, extend_existing_arrays: true, merge_hash_arrays: true)
|
|
32
|
+
src
|
|
33
|
+
end
|
|
23
34
|
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.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriele Tassoni
|
|
@@ -51,6 +51,20 @@ dependencies:
|
|
|
51
51
|
- - ">="
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
53
|
version: '0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: deep_merge
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '1.2'
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '1.2'
|
|
54
68
|
- !ruby/object:Gem::Dependency
|
|
55
69
|
name: rails-i18n
|
|
56
70
|
requirement: !ruby/object:Gem::Requirement
|