smart_params 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54e6652607fb402ff6368c2b0dc8d16c8b4fce3e45b0ad0aeb4d74ecc1798ab8
4
- data.tar.gz: 4c829acd140f7758ee9a8828a4627a554020b5f05773fea748440578d4506120
3
+ metadata.gz: 40c97c75606d4ca3e5e855708974260bcc4a42c04a17f8de4b47bff05e507ff7
4
+ data.tar.gz: 911b7fb1c4fd17e675776c6ba821cff381c5da0b08aecca2da63b04135b945d2
5
5
  SHA512:
6
- metadata.gz: 51f677d9c2c58724cb79a796665f987b2a5a9e7390f17b625b7dfac49907dd611bbbb7541d1b65d0fe1d98f13d4e68eeb03d1eb97cdeb3cfb90dd7c950777759
7
- data.tar.gz: 4bb161323aafc93aab63636dd32713dc42b37dd8a2a14e9bd6a5821cf52106d61b79437eb1412b2501d3a67de4790d17b7ecc2c280654d128c6cdd0edb19a022
6
+ metadata.gz: 19ec951b14113f439bbd9e30b26d933eeca020a7684c07be53d1f5e4e237d807711e6a163d40eb9bf633e7ff92216faa8d3797ecc20609cc0b87286d7023de36
7
+ data.tar.gz: ea29870d4218f83a8c981de2058d3675f5b627401bbe041262bc0f5e692b115826ba5b0631d0519d645e1f18d3414dc4cc65fb35b8f47876222e1876463da392
data/README.md CHANGED
@@ -132,7 +132,7 @@ Your model is already complex enough and it doesn't need the added baggage of fi
132
132
 
133
133
  Add this line to your application's Gemfile:
134
134
 
135
- gem "smart_params", "2.0.0"
135
+ gem "smart_params", "2.0.5"
136
136
 
137
137
  And then execute:
138
138
 
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.deep_stringify_keys
46
+ structure.as_json(options)
49
47
  end
50
48
  end
51
49
 
@@ -1,7 +1,5 @@
1
1
  module SmartParams
2
2
  class Field
3
- RECURSIVE_TREE = ->(accumulated, key) {accumulated[key] = Hash.new(&RECURSIVE_TREE)}
4
-
5
3
  attr_reader :keychain
6
4
  attr_reader :value
7
5
  attr_reader :subfields
@@ -1,3 +1,3 @@
1
1
  module SmartParams
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
3
3
  end
@@ -98,7 +98,7 @@ RSpec.describe SmartParams do
98
98
  it "returns as json" do
99
99
  expect(
100
100
  subject
101
- ).to eq(
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 eq(
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
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-04-23 00:00:00.000000000 Z
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.6
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