artirix_data_models 0.24.0 → 0.25.0

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
  SHA1:
3
- metadata.gz: 5297e305a2a81af12a820270e60c3e926abfa36f
4
- data.tar.gz: fac1f5b4d525b6dad5bde63d1883884ea99ccf70
3
+ metadata.gz: 8dfe7dd5276eb2921d0a32fe3463b24c10469612
4
+ data.tar.gz: 487b4f103a49cdb4246bbc641064ad615e58807f
5
5
  SHA512:
6
- metadata.gz: 2c68c1d44aeeb2c7252076b3cc7f18134cedd20b5d3aacb8d24b986e85125dadac0212a52e6c06564420fc70bc8db5aebcc001e92e4dac9e14aac6771659f240
7
- data.tar.gz: e8f4037838acd44d925970f9254049205a885fa428d3502f1771c52baa26b2c7d0c83dbe541d6c32823bfb852a9a0c16e6ff4d4be0d80551b849de39e99c2c44
6
+ metadata.gz: 9719fa95658855627b87ed6bc69869c71811d8a32734b6fc498bfaefd97d518d540f98e25b56c5407729b682b23164251847cfaeb7b2519fbee9df073152f0c2
7
+ data.tar.gz: ae324ff4c952554a354b088735489b6bfd24816dded5110aa2224524888f6a4e227c7ce785856a403ce275604554c10022dff6c322de50c58c79392708b19dc6
data/.travis.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.7
4
3
  - 2.3.0
5
4
  before_install: gem install bundler -v 1.11.2
6
5
 
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,
@@ -1,3 +1,3 @@
1
1
  module ArtirixDataModels
2
- VERSION = '0.24.0'
2
+ VERSION = '0.25.0'
3
3
  end
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.24.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-07-11 00:00:00.000000000 Z
11
+ date: 2016-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport