acts-as-dag 2.5.4 → 2.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/dag/edges.rb +2 -2
- data/test/dag_test.rb +11 -1
- data/test/database.test +0 -0
- metadata +4 -12
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.5
|
data/lib/dag/edges.rb
CHANGED
@@ -238,12 +238,12 @@ module Dag
|
|
238
238
|
|
239
239
|
protected
|
240
240
|
|
241
|
-
#Changes on a wire based on the count (destroy
|
241
|
+
# Changes on a wire based on the count (destroy or save!) (should not be called outside this plugin)
|
242
242
|
def push_associated_modification!(edge)
|
243
243
|
raise ActiveRecord::ActiveRecordError, 'ERROR: cannot modify our self in this way' if edge == self
|
244
244
|
edge.do_not_perpetuate = true
|
245
245
|
if edge.count == 0
|
246
|
-
edge.destroy
|
246
|
+
edge.destroy
|
247
247
|
else
|
248
248
|
edge.save!
|
249
249
|
end
|
data/test/dag_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require 'rubygems'
|
3
|
-
gem 'activerecord', '
|
3
|
+
gem 'activerecord', '~> 3.0.3'
|
4
4
|
require "./init"
|
5
5
|
|
6
6
|
|
@@ -842,4 +842,14 @@ class DagTest < Test::Unit::TestCase
|
|
842
842
|
assert_equal [c,d], path
|
843
843
|
end
|
844
844
|
|
845
|
+
# Tests that perpetuate upon destroy works
|
846
|
+
def tests_perpetuate_upon_destroy_link
|
847
|
+
a = Node.create!
|
848
|
+
b = Node.create!
|
849
|
+
c = Node.create!
|
850
|
+
e = Default.create_edge!(a,b)
|
851
|
+
f = Default.create_edge!(b,c)
|
852
|
+
e.destroy
|
853
|
+
end
|
854
|
+
|
845
855
|
end
|
data/test/database.test
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts-as-dag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 2
|
7
|
-
- 5
|
8
|
-
- 4
|
9
|
-
version: 2.5.4
|
4
|
+
prerelease:
|
5
|
+
version: 2.5.5
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Matthew Leventi
|
@@ -15,7 +11,7 @@ autorequire:
|
|
15
11
|
bindir: bin
|
16
12
|
cert_chain: []
|
17
13
|
|
18
|
-
date: 2011-
|
14
|
+
date: 2011-04-29 00:00:00 -07:00
|
19
15
|
default_executable:
|
20
16
|
dependencies: []
|
21
17
|
|
@@ -56,21 +52,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
52
|
requirements:
|
57
53
|
- - ">="
|
58
54
|
- !ruby/object:Gem::Version
|
59
|
-
segments:
|
60
|
-
- 0
|
61
55
|
version: "0"
|
62
56
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
57
|
none: false
|
64
58
|
requirements:
|
65
59
|
- - ">="
|
66
60
|
- !ruby/object:Gem::Version
|
67
|
-
segments:
|
68
|
-
- 0
|
69
61
|
version: "0"
|
70
62
|
requirements: []
|
71
63
|
|
72
64
|
rubyforge_project: acts-as-dag
|
73
|
-
rubygems_version: 1.
|
65
|
+
rubygems_version: 1.6.2
|
74
66
|
signing_key:
|
75
67
|
specification_version: 3
|
76
68
|
summary: Acts As DAG Gem
|