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 +4 -4
- data/lib/rails-settings/base.rb +4 -2
- data/lib/rails-settings/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f433f1f67e2ad2493d2ea5569115ee4af86f7d37a6e2abf033f3f780697fbc5f
|
4
|
+
data.tar.gz: 76593d4f3d843df0dbae34aaf0fbcce0ac9b89423dffef310c9de73c23e4e744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34f9a5afcdfb90d4524f69b121accf15011a770296a585d720e85e97b3500d226bb674cf2b28da68d3c619b7c8cd1c93ffa398a0142a5e2937fa0e04fb67621a
|
7
|
+
data.tar.gz: e21096b92f58e31bd8db19bb09694ee236188d2b57ec1a35dc74bf853d591eaab84c50915715d5d08639086010b72e496c013a2d1548c48b8904e947f274d753
|
data/lib/rails-settings/base.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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 = {}
|
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.
|
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
|