Class: YamlDb::Load

Inherits:
SerializationHelper::Load show all
Defined in:
lib/fidius-common/yamldb/yaml_db.rb

Class Method Summary collapse

Methods inherited from SerializationHelper::Load

load, load_records, load_table, reset_pk_sequence!, truncate_table

Class Method Details

.load_documents(io, truncate = true) ⇒ Object



63
64
65
66
67
68
69
70
# File 'lib/fidius-common/yamldb/yaml_db.rb', line 63

def self.load_documents(io, truncate = true)
  YAML.load_documents(io) do |ydoc|
    ydoc.keys.each do |table_name|
      next if ydoc[table_name].nil?
      load_table(table_name, ydoc[table_name], truncate)
    end
  end
end