rails-settings-cached 2.9.0 → 2.9.2
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/fields/array.rb +2 -0
- data/lib/rails-settings/fields/base.rb +10 -4
- data/lib/rails-settings/fields/big_decimal.rb +2 -0
- data/lib/rails-settings/fields/boolean.rb +2 -0
- data/lib/rails-settings/fields/float.rb +2 -0
- data/lib/rails-settings/fields/hash.rb +2 -0
- data/lib/rails-settings/fields/integer.rb +2 -0
- data/lib/rails-settings/fields/string.rb +2 -0
- data/lib/rails-settings/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 212d83f192f7446ef64cdb9d2217a8dfe9324a1b8c64b2389857ca2997e5f46a
|
4
|
+
data.tar.gz: 4a757c45119a1c31d5ce5d4d3a02af47adcd631856c8c3f403bb5303a0ff4e6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29aa302129ae5ee8950137df21d529b60c90cc3b251acf9760c20b857f75be8f4407a9f4ed2ed518646c1baa411c42513bd04886c22e9d8923c36a4962bb74f4
|
7
|
+
data.tar.gz: 2f205f829b23ed7d3cf691b9e9c7d6f4ac236b6767bd2240b65fee039390416453bce3a99dfdfeb892e0c8aa29950ecbfa5693dd302fea1ee853e7f671bd1a23
|
@@ -22,8 +22,10 @@ module RailsSettings
|
|
22
22
|
return parent.send(:_all_settings)[key] if table_exists?
|
23
23
|
|
24
24
|
# Fallback to default value if table was not ready (before migrate)
|
25
|
-
puts
|
26
|
-
|
25
|
+
puts(
|
26
|
+
"WARNING: table: \"#{parent.table_name}\" does not exist or not database connection, `#{parent.name}.#{key}` fallback to returns the default value."
|
27
|
+
)
|
28
|
+
nil
|
27
29
|
end
|
28
30
|
|
29
31
|
def default_value
|
@@ -62,8 +64,12 @@ module RailsSettings
|
|
62
64
|
private
|
63
65
|
|
64
66
|
def fetch_field_class(type)
|
65
|
-
field_class_name = type.to_s.split(
|
66
|
-
|
67
|
+
field_class_name = type.to_s.split("_").map(&:capitalize).join("")
|
68
|
+
begin
|
69
|
+
const_get("::RailsSettings::Fields::#{field_class_name}")
|
70
|
+
rescue StandardError
|
71
|
+
::RailsSettings::Fields::String
|
72
|
+
end
|
67
73
|
end
|
68
74
|
end
|
69
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-settings-cached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
161
|
+
rubygems_version: 3.4.1
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: The best solution for store global settings in Rails applications.
|