From 0ceb6b46cbe70612def8d9f27078ed4b2375b76f Mon Sep 17 00:00:00 2001 From: Hendyanto Date: Mon, 11 May 2015 10:14:03 +0700 Subject: [PATCH] Auto assign ZERO(0) to soft delete key if not specified by user eliminating problems from unspecified deleted status (unable to get / get all the records) --- core/MY_Model.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/MY_Model.php b/core/MY_Model.php index 05add98..293c810 100644 --- a/core/MY_Model.php +++ b/core/MY_Model.php @@ -210,6 +210,15 @@ public function insert($data, $skip_validation = FALSE) { $data = $this->validate($data); } + + /* Auto assign ZERO(0) to soft delete key if not specified by user*/ + if ($this->soft_delete) + { + if (!isset($data[$this->soft_delete_key])) + { + $data[$this->soft_delete_key] = 0; + } + } if ($data !== FALSE) {