feat: replace persist with insert (in memory)
This commit is contained in:
@@ -13,9 +13,9 @@ impl O {
|
|||||||
..O::default()
|
..O::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn persist(&mut self, entity: &mut Entity) {
|
pub fn insert(&mut self, object: impl ToEAV) {
|
||||||
self.items.insert(entity.id.clone(), entity.clone());
|
let entity = object.to_eav();
|
||||||
entity.persisted = true;
|
self.items.insert(entity.id.clone(), entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ mod tests {
|
|||||||
name: "laptop".to_string(),
|
name: "laptop".to_string(),
|
||||||
price: 200000u64,
|
price: 200000u64,
|
||||||
};
|
};
|
||||||
let mut entity = product.to_eav();
|
catalog.insert(product);
|
||||||
catalog.persist(&mut entity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user