rails-settings-cached 2.9.0 → 2.9.1
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/base.rb +10 -4
- data/lib/rails-settings/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39d71006c4cd637ddb495d703487eda60b7fb1c6ef7faebcf52154f69073a59b
|
4
|
+
data.tar.gz: 40520bb31ea809e805ad568a653b0c4f5cfbb80de54473c9aa8d55d8279f3b38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f95ff5d1b2833238b81c44aa326c4a137bd02e303d31df40bbcd85a8bdce178bdd2d9261d12b8ce0d67d75678c461f61de9ab79093b289194401f755aad0eef7
|
7
|
+
data.tar.gz: '0689d816a85358374c654f1f996ea1b6930b47fd9099333d25484276ebb326c332d4f594574b67d822961e04d4ecd55c4da8c80bd29266b751861b7960931502'
|
@@ -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.1
|
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-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|