smart_params 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/smart_params.rb +3 -5
- data/lib/smart_params/field.rb +0 -2
- data/lib/smart_params/version.rb +1 -1
- data/lib/smart_params_spec.rb +2 -2
- 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: 40c97c75606d4ca3e5e855708974260bcc4a42c04a17f8de4b47bff05e507ff7
|
4
|
+
data.tar.gz: 911b7fb1c4fd17e675776c6ba821cff381c5da0b08aecca2da63b04135b945d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19ec951b14113f439bbd9e30b26d933eeca020a7684c07be53d1f5e4e237d807711e6a163d40eb9bf633e7ff92216faa8d3797ecc20609cc0b87286d7023de36
|
7
|
+
data.tar.gz: ea29870d4218f83a8c981de2058d3675f5b627401bbe041262bc0f5e692b115826ba5b0631d0519d645e1f18d3414dc4cc65fb35b8f47876222e1876463da392
|
data/README.md
CHANGED
data/lib/smart_params.rb
CHANGED
@@ -8,8 +8,6 @@ module SmartParams
|
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
include Dry::Types.module
|
10
10
|
|
11
|
-
RECURSIVE_TREE = ->(accumulated, key) {accumulated[key] = Hash.new(&RECURSIVE_TREE)}
|
12
|
-
|
13
11
|
require_relative "smart_params/field"
|
14
12
|
require_relative "smart_params/error"
|
15
13
|
require_relative "smart_params/version"
|
@@ -41,11 +39,11 @@ module SmartParams
|
|
41
39
|
end
|
42
40
|
end
|
43
41
|
|
44
|
-
def as_json
|
42
|
+
def as_json(options = nil)
|
45
43
|
if @exception.present?
|
46
|
-
@exception.as_json
|
44
|
+
@exception.as_json(options)
|
47
45
|
else
|
48
|
-
structure.
|
46
|
+
structure.as_json(options)
|
49
47
|
end
|
50
48
|
end
|
51
49
|
|
data/lib/smart_params/field.rb
CHANGED
data/lib/smart_params/version.rb
CHANGED
data/lib/smart_params_spec.rb
CHANGED
@@ -98,7 +98,7 @@ RSpec.describe SmartParams do
|
|
98
98
|
it "returns as json" do
|
99
99
|
expect(
|
100
100
|
subject
|
101
|
-
).to
|
101
|
+
).to match(
|
102
102
|
{
|
103
103
|
"data" => hash_including(
|
104
104
|
{
|
@@ -144,7 +144,7 @@ RSpec.describe SmartParams do
|
|
144
144
|
it "returns as json" do
|
145
145
|
expect(
|
146
146
|
subject
|
147
|
-
).to
|
147
|
+
).to match(
|
148
148
|
hash_including(
|
149
149
|
{
|
150
150
|
"data" => hash_including(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurtis Rainbolt-Greene
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.7.
|
176
|
+
rubygems_version: 2.7.3
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Apply an organized and easy to maintain schema to request params
|