Class: JsonDb::Load
- Inherits:
-
SerializationHelper::Load
- Object
- SerializationHelper::Load
- JsonDb::Load
- Defined in:
- lib/json_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
65 66 67 68 69 70 71 72 |
# File 'lib/json_db.rb', line 65 def self.load_documents(io, truncate = true) JSON.load(io).tap do |json| json.keys.each do |table_name| next if json[table_name].nil? load_table(table_name, json[table_name], truncate) end end end |