blueprint_config 1.1.0 → 1.2.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/lib/blueprint_config/backend/active_record.rb +7 -2
- data/lib/blueprint_config/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cd1d77adc1c5b0c6804976f701d7169aa95dde0fbb759223bf5f866d3dcb6ce
|
4
|
+
data.tar.gz: a2afa1abc74f9353444ee4a03c8afd256ba56521f5d914376f145367caa9b70b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcc11edd92aed918514ec06d6da8b8fe98033ceed743d8bb710d8263bcb93460ee089d6299c31a969d93cfe7997aab707b5d5749a6af99e4383a0870a2d64201
|
7
|
+
data.tar.gz: 3363d88bfbc0da672f308f4d528b256399a4ac0c5364e2a4c25f298e84bf951f41feab992c071d5f74f978df7695cd9fcb3c49998c83ceae705c9f7ed3e2f9f3
|
@@ -51,13 +51,18 @@ module BlueprintConfig
|
|
51
51
|
|
52
52
|
def fresh?
|
53
53
|
# if database is not create/configured yet - don't try to refresh settings from it
|
54
|
-
return true
|
54
|
+
return true unless @configured
|
55
55
|
return true if @last_checked_at.present? && @last_checked_at > 1.second.ago
|
56
56
|
|
57
57
|
@mutex.synchronize do
|
58
58
|
@last_checked_at = Time.now
|
59
59
|
end
|
60
|
-
|
60
|
+
max_updated_at = Setting.maximum(:updated_at)
|
61
|
+
|
62
|
+
# if there is no settings in the database - don't try to refresh settings from it'
|
63
|
+
return true if max_updated_at.blank?
|
64
|
+
|
65
|
+
@updated_at.present? && @updated_at >= max_updated_at
|
61
66
|
end
|
62
67
|
end
|
63
68
|
end
|