rails-settings-cached 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -1
- data/lib/rails-settings/base.rb +1 -1
- 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: 29703d30ef00244c99b49047ce3a05edd212ee71a23433cb581d5bf69c6a02c6
|
4
|
+
data.tar.gz: 7f1d2dffdf1c552faca1b7afdbaaeaa52039897afb5364b8aef37de3d93389c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e1b41ac975dd31fadf90c5d9c059542aaeb09a0bfbf3f137266a32ae58c30557afedbe33c775af9a2683a8f8b56b85ee0f94b4a063a27e5c79176b5c1714d0d
|
7
|
+
data.tar.gz: a5ee74e8dd391aab429db68904b5d78a79581fd41de6304aece887fcdf9be8b023f4fff03a2fedbfdbc81cff964be5b695a90c5e4c3f908d49bed01c0fb70f83
|
data/README.md
CHANGED
@@ -162,9 +162,23 @@ class Setting < RailsSettings::Base
|
|
162
162
|
end
|
163
163
|
```
|
164
164
|
|
165
|
-
Now validate will work on record save
|
165
|
+
Now validate will work on record save:
|
166
166
|
|
167
167
|
```rb
|
168
|
+
irb> Setting.app_name = ""
|
169
|
+
ActiveRecord::RecordInvalid: (Validation failed: App name can't be blank)
|
170
|
+
irb> Setting.app_name = "Rails Settings"
|
171
|
+
"Rails Settings"
|
172
|
+
irb> Setting.default_locale = "zh-TW"
|
173
|
+
ActiveRecord::RecordInvalid: (Validation failed: Default locale is not included in [zh-CN, en, jp])
|
174
|
+
irb> Setting.default_locale = "en"
|
175
|
+
"en"
|
176
|
+
```
|
177
|
+
|
178
|
+
Validate by `save` / `valid?` method:
|
179
|
+
|
180
|
+
```rb
|
181
|
+
|
168
182
|
setting = Setting.find_or_initialize_by(var: :app_name)
|
169
183
|
setting.value = ""
|
170
184
|
setting.valid?
|
data/lib/rails-settings/base.rb
CHANGED
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.5.
|
4
|
+
version: 2.5.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: 2020-12-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.0
|
152
|
+
rubygems_version: 3.2.0
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: The best solution for store global settings in Rails applications.
|