summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/axlsx/rels/relationship.rb4
-rw-r--r--test/tc_helper.rb4
2 files changed, 1 insertions, 7 deletions
diff --git a/lib/axlsx/rels/relationship.rb b/lib/axlsx/rels/relationship.rb
index 64356d46..5e75a98a 100644
--- a/lib/axlsx/rels/relationship.rb
+++ b/lib/axlsx/rels/relationship.rb
@@ -14,9 +14,7 @@ module Axlsx
# Generate and return a unique id. Used for setting {#Id}.
# @return [String]
def next_free_id
- @next_free_id_counter ||= 0
- @next_free_id_counter += 1
- "rId#{@next_free_id_counter}"
+ "rId#{@instances.size + 1}"
end
end
diff --git a/test/tc_helper.rb b/test/tc_helper.rb
index c09446b7..af40a1e4 100644
--- a/test/tc_helper.rb
+++ b/test/tc_helper.rb
@@ -8,7 +8,3 @@ end
require 'test/unit'
require "timecop"
require "axlsx.rb"
-
-# Make sure all valid rIds are > 1000 - this should help catching the cases where rId is still
-# determined by looking at the index of an object in an array etc.
-Axlsx::Relationship.instance_variable_set :@next_free_id_counter, 1000