cowtech-rails 1.7.9.0 → 1.8.0.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -144,8 +144,8 @@ module Cowtech
|
|
144
144
|
self.crud_query_initialize(data) unless data[:query_initialized]
|
145
145
|
parameter = :search unless parameter
|
146
146
|
|
147
|
-
self.crud_query_add_condition(data, "(#{self.crud_get_class(data).table_name}.#{self.crud_get_class(data).deleted_column}
|
148
|
-
|
147
|
+
self.crud_query_add_condition(data, "(#{self.crud_get_class(data).table_name}.#{self.crud_get_class(data).deleted_column} IS NULL)", {}) unless data[:skip_deleted]
|
148
|
+
|
149
149
|
# GET QUERY
|
150
150
|
args = params[parameter] unless args
|
151
151
|
|
@@ -9,7 +9,7 @@ module Cowtech
|
|
9
9
|
module Models
|
10
10
|
class ModelBase < ::ActiveRecord::Base
|
11
11
|
def self.deleted_column
|
12
|
-
"
|
12
|
+
"deleted_at"
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.status_column
|
@@ -40,7 +40,7 @@ module Cowtech
|
|
40
40
|
if !definitive then
|
41
41
|
if self.deletable? then
|
42
42
|
if self.has_attribute?(self.class.deleted_column) then
|
43
|
-
self.update_attribute(self.class.deleted_column,
|
43
|
+
self.update_attribute(self.class.deleted_column, DateTime.now)
|
44
44
|
true
|
45
45
|
elsif self.has_attribute?(self.class.status_column) then
|
46
46
|
self.update_attribute(self.class.status_column, self.deleted_status)
|
data/lib/cowtech/version.rb
CHANGED