rails-settings-cached 2.0.2 → 2.0.3

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: 2f5d17c59cd0c8b1c7c587169c32a7b7003c9067086a7b43e40d716973c8b104
4
- data.tar.gz: 9e4b276543867580abcfa9da999fe3e81303459df28db49c76f2e75bef6679e7
3
+ metadata.gz: f433f1f67e2ad2493d2ea5569115ee4af86f7d37a6e2abf033f3f780697fbc5f
4
+ data.tar.gz: 76593d4f3d843df0dbae34aaf0fbcce0ac9b89423dffef310c9de73c23e4e744
5
5
  SHA512:
6
- metadata.gz: 4be5e67948d944b2daa60c574586e297b638fc17e828a4923dc010ad691402b69bd8b06c823b228a3eaedafbd00fc2796d43c7986cb34a3bc0e5ae401eae8647
7
- data.tar.gz: 7021a6b8d97b31f3f28557f51bef405cf5cfba5ed2194ee50d1b56ce599e1ca1aa288498d39c3ceefadd0618781610bd12344cf468b826ee4b7125fc640ce267
6
+ metadata.gz: 34f9a5afcdfb90d4524f69b121accf15011a770296a585d720e85e97b3500d226bb674cf2b28da68d3c619b7c8cd1c93ffa398a0142a5e2937fa0e04fb67621a
7
+ data.tar.gz: e21096b92f58e31bd8db19bb09694ee236188d2b57ec1a35dc74bf853d591eaab84c50915715d5d08639086010b72e496c013a2d1548c48b8904e947f274d753
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "request_store"
4
+
3
5
  module RailsSettings
4
6
  class Base < ActiveRecord::Base
5
7
  class SettingNotFound < RuntimeError; end
@@ -23,7 +25,7 @@ module RailsSettings
23
25
 
24
26
  class << self
25
27
  def clear_cache
26
- Thread.current[:rails_settings_all_settings] = nil
28
+ RequestStore.store[:rails_settings_all_settings] = nil
27
29
  Rails.cache.delete(self.cache_key)
28
30
  end
29
31
 
@@ -114,7 +116,7 @@ module RailsSettings
114
116
 
115
117
  def _all_settings
116
118
  raise "You can use settings before Rails initialize." unless rails_initialized?
117
- Thread.current[:rails_settings_all_settings] ||= begin
119
+ RequestStore.store[:rails_settings_all_settings] ||= begin
118
120
  Rails.cache.fetch(self.cache_key, expires_in: 1.week) do
119
121
  vars = unscoped.select("var, value")
120
122
  result = {}
@@ -3,7 +3,7 @@
3
3
  module RailsSettings
4
4
  class << self
5
5
  def version
6
- "2.0.2"
6
+ "2.0.3"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-settings-cached
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: request_store
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sqlite3
29
43
  requirement: !ruby/object:Gem::Requirement