smart_params 2.0.5 → 2.0.6

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: 40c97c75606d4ca3e5e855708974260bcc4a42c04a17f8de4b47bff05e507ff7
4
- data.tar.gz: 911b7fb1c4fd17e675776c6ba821cff381c5da0b08aecca2da63b04135b945d2
3
+ metadata.gz: f216f02ebccbcfbe69692ca651d6b498a32e0aad5489214fe5080c25fd16049c
4
+ data.tar.gz: f378546a99befd976fe15792a44a596a2d46fca01df46cc908e5c0cea39ca0ac
5
5
  SHA512:
6
- metadata.gz: 19ec951b14113f439bbd9e30b26d933eeca020a7684c07be53d1f5e4e237d807711e6a163d40eb9bf633e7ff92216faa8d3797ecc20609cc0b87286d7023de36
7
- data.tar.gz: ea29870d4218f83a8c981de2058d3675f5b627401bbe041262bc0f5e692b115826ba5b0631d0519d645e1f18d3414dc4cc65fb35b8f47876222e1876463da392
6
+ metadata.gz: 6eeb0425ba7a69364842c3c56d6d29a57f4711d6ef7af9c29a658df1998c7b35c5782ec18c1e0c656dd7faa09bb00d1e1cdf41efd8ecebf5f7c6f9cb00b9f9e4
7
+ data.tar.gz: b718ead8ded3f5d7bc6ff4ece9892051da9d580892b3087e2594c05211e1d0b92d84fd13ecaccb54aad5e7ff1b6417c44363f6823b6c5b5e10477995182acd14
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.5"
135
+ gem "smart_params", "2.0.6"
136
136
 
137
137
  And then execute:
138
138
 
@@ -28,13 +28,8 @@ module SmartParams
28
28
  end
29
29
 
30
30
  def to_hash
31
- *chain, key = keychain
32
- Hash.new(&RECURSIVE_TREE).tap do |tree|
33
- if chain.any?
34
- tree.dig(*chain)[key] = value
35
- else
36
- tree[key] = value
37
- end
31
+ keychain.reverse.reduce(value) do |accumulation, key|
32
+ { key => accumulation }
38
33
  end
39
34
  end
40
35
 
@@ -1,3 +1,3 @@
1
1
  module SmartParams
2
- VERSION = "2.0.5"
2
+ VERSION = "2.0.6"
3
3
  end
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.5
4
+ version: 2.0.6
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-05-07 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler