tramway 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tramway/base_form.rb +1 -1
- data/lib/tramway/forms/normalizations.rb +4 -2
- data/lib/tramway/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: cae2dee0a95959ec9a4d2edb886ffd6fbd2ec305770e0ba78f9dc09f04d641ce
|
4
|
+
data.tar.gz: e3d287cd49a4b181279aa8574bec79364af8b9c0b240299cddb3f7ae18dfcd55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2cdabe494be288cc8c1d538b727e41cfa0ce2d8d0c49ca8be1561dbc1780e4ba5826be7ee9c9d7c62dff3749b0a94568f747d03d35405c74a22e62b24e210d3
|
7
|
+
data.tar.gz: 36b601a82003ea9c623247d57a068b60fb98998265d7d5dc2a9f505c8e8accbf7ba4e7831bf36601fb05e8b952600bd16900c84db7e8fe4b421b408349914ca5
|
data/lib/tramway/base_form.rb
CHANGED
@@ -37,10 +37,12 @@ module Tramway
|
|
37
37
|
base.extend ClassMethods
|
38
38
|
end
|
39
39
|
|
40
|
+
# :reek:NilCheck { enabled: false }
|
40
41
|
def __apply_normalizations(params)
|
41
42
|
self.class.normalizations.reduce(params) do |hash, (attribute, normalization)|
|
42
|
-
|
43
|
-
|
43
|
+
value = hash[attribute]
|
44
|
+
if hash.key?(attribute) && (!value.nil? || normalization[:apply_to_nil])
|
45
|
+
hash.merge(attribute => instance_exec(value, &normalization[:proc]))
|
44
46
|
else
|
45
47
|
hash
|
46
48
|
end
|
data/lib/tramway/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kalashnikovisme
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-struct
|