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 +4 -4
- data/lib/decorators/wallaby/resource_decorator.rb +6 -0
- data/lib/utils/wallaby/utils.rb +4 -2
- data/lib/wallaby/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 561244424ca5d0d5b85b73dc39d9aefd5051c20a9301700f7579ec13692beeab
|
4
|
+
data.tar.gz: e69e6787f54fd2a1e6bc777679a2a4adfa6c473a074eba85fff9fcb781a5c757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/utils/wallaby/utils.rb
CHANGED
@@ -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
|
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
|
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
|
data/lib/wallaby/core/version.rb
CHANGED
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
|
+
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-
|
11
|
+
date: 2022-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|