common-data-caching 1.0.1.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: 8d993bdf8ab0f1503544c70a601758a8d99e8374263105c7e4449fb45547cbab
4
- data.tar.gz: 3af757debe589422361cb8a724ff159d2e70f2c616f7970edef17fd11134f19b
3
+ metadata.gz: 799fc5654b06ad34518f953901eca1e9bb7b8fc71239aa15a0307ac1a9cca495
4
+ data.tar.gz: 5ef2e5c70537a749b9be61123aa05a5014324e428e35d598ebc76eca850caab9
5
5
  SHA512:
6
- metadata.gz: 1c41bf2807d4e37c47bd44881f0ae4a4548dff6a878a3541457a13c7f25fe06e89e06b4aef851f7cc7328f75bf23b3c775dc723173ea0cb19c48a5f9fb0f1841
7
- data.tar.gz: acac86a8bcccb1162a30cc01ba15509dd0de9ec55d2249a1547eff923512613617757293d5fc1ad622730c7a5bf4d7703c336eaa87594caa604eb40eda616ebc
6
+ metadata.gz: f783a29acf2aa84ec03c50829cd29f668c197221ba20a3327b377834efbbd7bc9463a6497704cf01305423c6600c3b4465c8504e1117b744eff685fadfbe4940
7
+ data.tar.gz: 76e0cf971f736df05a361ef5b442c00c5700615187d2a44b75faa8293dd0a639c6dd3d1193dd22be4fc4aba72fb4aa2afe15929a8ef96c62d114d69c29992614
data/README.md CHANGED
@@ -41,6 +41,12 @@ end
41
41
  User.common_data_cache_collection
42
42
  ```
43
43
 
44
+ Для получения версий коллекций кеша общих данных вызовите:
45
+
46
+ ```ruby
47
+ CommonDataCaching.versions
48
+ ```
49
+
44
50
  ### Сортировка
45
51
 
46
52
  Для применения сортировки, передайте опцию `order`:
@@ -18,13 +18,13 @@ module CommonDataCaching
18
18
  ordering = cache_opts[:order] || :id
19
19
 
20
20
  data = merge(scope).order(ordering).prepare_common_data_collection
21
- Rails.cache.write(common_cache_key, data)
21
+ Rails.cache.write(common_data_cache_key, data)
22
22
  end
23
23
 
24
24
  def update_common_data_cache_versions
25
- versions = Rails.cache.read('common_cache_versions') || {}
25
+ versions = Rails.cache.read('common-data-caching-versions') || {}
26
26
  versions[to_s] = Time.now.to_i
27
- Rails.cache.write('common_cache_versions', versions)
27
+ Rails.cache.write('common-data-caching-versions', versions)
28
28
  end
29
29
 
30
30
  def prepare_common_data_collection
@@ -4,6 +4,11 @@ require 'common_data_caching/class_methods'
4
4
  require 'common_data_caching/rake_tasks'
5
5
 
6
6
  module CommonDataCaching
7
+
8
+ def self.versions
9
+ Rails.cache.read('common-data-caching-versions') || {}
10
+ end
11
+
7
12
  end
8
13
 
9
14
  ActiveSupport.on_load(:active_record) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common-data-caching
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Павел Бабин