paramore 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paramore/cast_parameters.rb +5 -15
- 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: fb73686fb48a297c559c211476f565f8aba18a2e93a10936b75cacd4eab2bcb2
|
4
|
+
data.tar.gz: df12fd5715e1c4e3851a1ed2f9748f24cccec9d9ccc817c7b6ba74960370f426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d7f2e6f52065f18ebb5b7d51577950ceb234db5f5a21fd3a20fdb987066c451da22beda1bc86a4101ad9bfaf4ccf195a38b1281b02c92c4d8cc2d1fa6602958
|
7
|
+
data.tar.gz: b5dd8ae054488a628c580924cfdfb0355ef063a43eb7e46fe249ae9ecad62a4a80d5603b4eed182d1b69c1d691926c97165c605b11d05eec4b5ed66efbc3cac3
|
@@ -4,17 +4,7 @@ module Paramore
|
|
4
4
|
module CastParameters
|
5
5
|
module_function
|
6
6
|
def run(field, data)
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
def recursive_merge(nested_hash_array)
|
11
|
-
nested_hash_array.reduce(:merge).map do |name, value|
|
12
|
-
if value.is_a?(Array) && value.all? { |_value| _value.is_a?(Hash) }
|
13
|
-
{ name => recursive_merge(value) }
|
14
|
-
else
|
15
|
-
{ name => value }
|
16
|
-
end
|
17
|
-
end.reduce(:merge)
|
7
|
+
cast(field, data, 'data')
|
18
8
|
end
|
19
9
|
|
20
10
|
def cast(field, value, name = nil)
|
@@ -37,15 +27,15 @@ module Paramore
|
|
37
27
|
end
|
38
28
|
|
39
29
|
def typecast_hash(field, hash)
|
40
|
-
field.
|
41
|
-
{ name => cast(field, hash[name], name) }
|
42
|
-
end
|
30
|
+
field.to_h { |name, field| [name, cast(field, hash[name], name)] }
|
43
31
|
end
|
44
32
|
|
45
33
|
def typecast_array(field, array)
|
46
34
|
array
|
47
35
|
.reject { |unit| unit.to_s == '' && field.compact? }
|
48
|
-
.map
|
36
|
+
.map do |unit|
|
37
|
+
cast(Paramore.field(field.type.first, null: true), unit)
|
38
|
+
end
|
49
39
|
end
|
50
40
|
|
51
41
|
def typecast_value(type, value)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paramore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Kairevičius
|
@@ -101,7 +101,7 @@ licenses:
|
|
101
101
|
- MIT
|
102
102
|
metadata: {}
|
103
103
|
post_install_message: |
|
104
|
-
Thank you for installing Paramore 3.1.
|
104
|
+
Thank you for installing Paramore 3.1.1 !
|
105
105
|
From the command line you can run `paramore` to generate a configuration file
|
106
106
|
|
107
107
|
More details here : https://github.com/lumzdas/paramore/blob/master/README.md
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
123
|
+
rubygems_version: 3.0.8
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: A declarative approach to Rails' strong parameter typing and sanitizing
|