artirix_data_models 0.24.0 → 0.25.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 +4 -4
- data/.travis.yml +0 -1
- data/README.md +3 -0
- data/lib/artirix_data_models/model.rb +13 -0
- data/lib/artirix_data_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dfe7dd5276eb2921d0a32fe3463b24c10469612
|
4
|
+
data.tar.gz: 487b4f103a49cdb4246bbc641064ad615e58807f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9719fa95658855627b87ed6bc69869c71811d8a32734b6fc498bfaefd97d518d540f98e25b56c5407729b682b23164251847cfaeb7b2519fbee9df073152f0c2
|
7
|
+
data.tar.gz: ae324ff4c952554a354b088735489b6bfd24816dded5110aa2224524888f6a4e227c7ce785856a403ce275604554c10022dff6c322de50c58c79392708b19dc6
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -327,6 +327,9 @@ end
|
|
327
327
|
|
328
328
|
## Changes
|
329
329
|
|
330
|
+
### 0.25.0
|
331
|
+
- *IMPORTANT FIX*: prevent infinite loop in Model's `cache_key` method, where if `_timestamp` is nil, it will try to load `updated_at`. If that's not part of the partial mode, it will force a reload, which will get a cache_key, which will ask for `updated_at`, which will force a reload...
|
332
|
+
|
330
333
|
### 0.24.0
|
331
334
|
- add `headers` to Gateway, to Connection and to DAO methods. It expect a hash of key-value that will be passed to the Faraday call after the body of the request.
|
332
335
|
|
@@ -367,9 +367,22 @@ module ArtirixDataModels
|
|
367
367
|
SEPARATOR = '/'.freeze
|
368
368
|
|
369
369
|
def cache_key
|
370
|
+
# we do not want to force a reload for loading the cache key, it can lead to an infinite loop
|
371
|
+
# so if the model is in partial mode, we mark it as full mode, and back as partial later.
|
372
|
+
temp_full_mode = false
|
373
|
+
if try(:partial_mode?)
|
374
|
+
temp_full_mode = true
|
375
|
+
try(:mark_full_mode)
|
376
|
+
end
|
377
|
+
|
370
378
|
m = try(:model_dao_name) || self.class
|
371
379
|
i = try(:primary_key) || try(:id) || try(:object_id)
|
372
380
|
t = try(:_timestamp) || try(:updated_at) || EMPTY_TIMESTAMP
|
381
|
+
|
382
|
+
if temp_full_mode
|
383
|
+
try(:mark_partial_mode)
|
384
|
+
end
|
385
|
+
|
373
386
|
[
|
374
387
|
m.to_s.parameterize,
|
375
388
|
i.to_s.parameterize,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artirix_data_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.25.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Turiño
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|