reload

Reloads the record from the DB, overwrites it. Returns a reference to the same object.

ref
T
reload
(
T
)
(
ref T record
)

Examples

1 User user = User.first;
2 writeln("My user is: ", user);
3 user.update(["username": "Oopdated Ooser"]);
4 writeln("My user is: ", user);
5 writeln("My user from DB is: ", User.find(user.id));
6 writeln("Reloaded user ", user.reload); // will be same as above

Meta