disposable 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/disposable/twin.rb +3 -2
- data/lib/disposable/version.rb +1 -1
- data/test/twin/twin_test.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a849e6821b6f0c16d1da767e93e54b002c601bbe
|
4
|
+
data.tar.gz: 0ef377dd5917ab403610f220db4492cb22d664ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8716242c4c3d3f7a1b9df458418904d302f5f491cb3f52dfc547bd722e9e256f697142449d06e193ce1e0779dcf6ca2e34a6c457d7e0a8333d0264afdeb46ec
|
7
|
+
data.tar.gz: d8b3aa1cbe5a52e48d09c6b3d2e5054aa4a5fea7a73b99966a224fe41d6aaf8ecab81d59a08c283ccb226e5865a36cd89fa30d5510468d54c4c319c5031374b9
|
data/CHANGES.md
CHANGED
data/lib/disposable/twin.rb
CHANGED
@@ -97,8 +97,9 @@ module Disposable
|
|
97
97
|
private
|
98
98
|
# assumption: collections are always initialized from Setup since we assume an empty [] for "nil"/uninitialized collections.
|
99
99
|
def write_property(name, value, dfn)
|
100
|
-
|
101
|
-
|
100
|
+
if dfn[:twin] and value
|
101
|
+
value = dfn.array? ? wrap_collection(dfn, value) : wrap_scalar(dfn, value)
|
102
|
+
end
|
102
103
|
|
103
104
|
field_write(name, value)
|
104
105
|
end
|
data/lib/disposable/version.rb
CHANGED
data/test/twin/twin_test.rb
CHANGED
@@ -74,6 +74,17 @@ class TwinTest < MiniTest::Spec
|
|
74
74
|
song.title.must_equal "Broken"
|
75
75
|
end
|
76
76
|
|
77
|
+
describe "deleting" do
|
78
|
+
it "allows overwriting nested twin with nil" do
|
79
|
+
album = Model::Album.new(1, "Uncertain Terms", [], artist=Model::Artist.new("Greg Howe"))
|
80
|
+
twin = Twin::Album.new(album)
|
81
|
+
twin.artist.id.must_equal "Greg Howe"
|
82
|
+
|
83
|
+
twin.artist = nil
|
84
|
+
twin.artist.must_equal nil
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
77
88
|
# setters for twin properties return the twin, not the model
|
78
89
|
# it do
|
79
90
|
# result = twin.album = album
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disposable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uber
|