active_node 0.0.9 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_node/persistence.rb +1 -1
- data/lib/active_node/version.rb +1 -1
- data/spec/functional/persistence_spec.rb +10 -1
- data/spec/models/address.rb +2 -0
- data/spec/models/client.rb +1 -0
- data/spec/models/person.rb +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 633b4897fb41d52b43a38c447293075952130222
|
4
|
+
data.tar.gz: c939c9511b4c5a01f1161f37eb23adbe0dac2ae9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de208cc8bc0ca9a337440cec472ac500536461859b8b716c515f834ce9225350dcf54a9dc1744a8e9b0e021441f77258269d2ed11a17e6a273f5f027e3641107
|
7
|
+
data.tar.gz: 50e23dff5cf8d65cc6e42084b34e74766cfd879a14abe31731ff2b960d8963b646465b5aca47cfbc01883ed6da171c5fcde6deda6df729b33878191f21a6f26e
|
data/lib/active_node/version.rb
CHANGED
@@ -33,7 +33,7 @@ describe ActiveNode::Persistence do
|
|
33
33
|
person = Person.find(person.id)
|
34
34
|
person.created_at.should_not be_nil
|
35
35
|
person.updated_at.should_not be_nil
|
36
|
-
allow(Time).to receive(:now) {now + 1.second}
|
36
|
+
allow(Time).to receive(:now) { now + 1.second }
|
37
37
|
person.name = 'abc'
|
38
38
|
person.save
|
39
39
|
(person.created_at < person.updated_at).should be_true
|
@@ -64,4 +64,13 @@ describe ActiveNode::Persistence do
|
|
64
64
|
Person.create!(name: 'abc').attributes['id'].should_not be_nil
|
65
65
|
end
|
66
66
|
end
|
67
|
+
|
68
|
+
describe "#incoming" do
|
69
|
+
it "can retrieve heterogenous models" do
|
70
|
+
a = Address.create!
|
71
|
+
p=Person.create!(name: 'abc', address: a)
|
72
|
+
c=Client.create!(name: 'client', address: a)
|
73
|
+
a.incoming(:address).should include(p, c)
|
74
|
+
end
|
75
|
+
end
|
67
76
|
end
|
data/spec/models/client.rb
CHANGED
data/spec/models/person.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_node
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heinrich Klobuczek
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- spec/functional/associations_spec.rb
|
160
160
|
- spec/functional/persistence_spec.rb
|
161
161
|
- spec/functional/validations_spec.rb
|
162
|
+
- spec/models/address.rb
|
162
163
|
- spec/models/client.rb
|
163
164
|
- spec/models/neo_user.rb
|
164
165
|
- spec/models/person.rb
|
@@ -190,6 +191,7 @@ test_files:
|
|
190
191
|
- spec/functional/associations_spec.rb
|
191
192
|
- spec/functional/persistence_spec.rb
|
192
193
|
- spec/functional/validations_spec.rb
|
194
|
+
- spec/models/address.rb
|
193
195
|
- spec/models/client.rb
|
194
196
|
- spec/models/neo_user.rb
|
195
197
|
- spec/models/person.rb
|