wallaby-core 0.2.4 → 0.2.7

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: 549512f63ab75eb29715ca2842daba07744482836896ddbf8d58ee873eeda983
4
- data.tar.gz: 7997ba9973a504145d363673a5ea222013358673601cb0304bdf6d22a74b927e
3
+ metadata.gz: 561244424ca5d0d5b85b73dc39d9aefd5051c20a9301700f7579ec13692beeab
4
+ data.tar.gz: e69e6787f54fd2a1e6bc777679a2a4adfa6c473a074eba85fff9fcb781a5c757
5
5
  SHA512:
6
- metadata.gz: 2eaff56ae4c69091a6de82f5ae4e067b65490aec8b76a54ff602b6714957e4ccf90b6ddec573032868941d5868bccde3c000ee038cb19dfe8d0cfc5fa12cf08e
7
- data.tar.gz: 55c273983a048eb454248efe777b2abb9fb72e4a969792b3d33483b5b4944740ca1555e98fb41b25c558188420cb5a27fbd9c3aa5094786ee623fc6b81a3522f
6
+ metadata.gz: a3801a6c6821c368283231242a3aea7904efe5607abf493ea6a78e7037a164d4694c5e943a5666bdb011e829a131a4a10224777c9244175ee5c7f0422a2c7d1d
7
+ data.tar.gz: dc87bb488d939082c4ab2417595cc40cc4c2cba003d59c2ce6a5c5a957a6edd88050ced518aa823972378c6a736568de64f54f03d6af6cebd21ed8335cd9e547
@@ -158,5 +158,11 @@ module Wallaby
158
158
  def respond_to_missing?(method_id, _include_private)
159
159
  resource.respond_to?(method_id) || super
160
160
  end
161
+
162
+ # @see https://github.com/rails/rails/compare/v7.0.2.4..7-0-stable#diff-44b94eca66c7497711821a8e6bcdfde4684bb7b8efa15e64da6532449f03ef0bR441
163
+ # @note This overwritten method is a response to the above change
164
+ def to_model
165
+ self
166
+ end
161
167
  end
162
168
  end
@@ -7,11 +7,13 @@ module Wallaby
7
7
  # @param object [Object]
8
8
  # @return [Object] a clone object
9
9
  def self.clone(object)
10
- # NOTE: Neither marshal/deep_dup/dup achieves real and correct deep copy,
10
+ # NOTE: Neither marshal/deep_dup/dup are able to achieve real and correct deep copy,
11
11
  # so here we need a custom solution below:
12
12
  case object
13
13
  when Hash
14
- object.each_with_object(object.class.new) { |(key, value), hash| hash[key] = clone(value) }
14
+ object
15
+ .each_with_object(object.class.new) { |(key, value), hash| hash[key] = clone(value) }
16
+ .tap { |hash| hash.default = object.default }
15
17
  when Array
16
18
  object.each_with_object(object.class.new) { |value, array| array << clone(value) }
17
19
  when Class
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Wallaby
4
4
  module Core
5
- VERSION = '0.2.4' # :nodoc:
5
+ VERSION = '0.2.7' # :nodoc:
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wallaby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tian Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-06 00:00:00.000000000 Z
11
+ date: 2022-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel