Partition#get(unknown_partition) returns []
parent
74aff338ff
commit
f8e4e6c343
|
@ -307,6 +307,8 @@ describe "DODB::DataBase" do
|
|||
a && b
|
||||
}.should be_true
|
||||
end
|
||||
|
||||
db_ships_by_class.get("does-not-exist").should eq [] of Ship
|
||||
end
|
||||
|
||||
it "removes select elements from partitions" do
|
||||
|
|
|
@ -43,6 +43,9 @@ class DODB::Partition(V) < DODB::Indexer(V)
|
|||
r_value = Array(V).new
|
||||
|
||||
partition_directory = indexing_directory partition
|
||||
|
||||
return r_value unless Dir.exists? partition_directory
|
||||
|
||||
Dir.each_child partition_directory do |child|
|
||||
r_value << V.from_json ::File.read "#{partition_directory}/#{child}"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue