Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

en crud update

redraiment edited this page Jun 2, 2014 · 1 revision

Record#set can modify the value in current record, but won't save to database until call Record#save.

Record jim = Zombie.find(3);
jim.set("graveyard", "Benny Hills Memorial").save();

To simple above operators, Record provides update(Object... args) to modify & save to database in one step.

jim.update("graveyard:", "Benny Hills Memorial"); // Same with above

Same with query, above methods support named parameters as well, and Table also provides save(Record o) method to update record from an existing record.

Clone this wiki locally