lib/saga/document.rb in saga-0.5.0 vs lib/saga/document.rb in saga-0.5.1

- old
+ new

@@ -31,9 +31,13 @@ def length stories.inject(0) { |total, (_, stories)| total + stories.length } end + def empty? + length == 0 + end + def autofill_ids unused_ids = unused_ids(length - used_ids.length) stories.each do |_, stories| stories.each do |story| story[:id] ||= unused_ids.shift \ No newline at end of file