organizze_permanent_records 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,12 +38,13 @@ module OrganizzePermanentRecords
|
|
38
38
|
end
|
39
39
|
|
40
40
|
module EarlyRails
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
|
42
|
+
def with_deleted(*args)
|
43
|
+
with_exclusive_scope do
|
44
|
+
find(*args)
|
44
45
|
end
|
45
46
|
end
|
46
|
-
|
47
|
+
|
47
48
|
def with_not_deleted
|
48
49
|
with_scope :find => {:conditions => "#{quoted_table_name}.deleted_at IS NULL"} do
|
49
50
|
yield
|
@@ -109,7 +110,7 @@ module OrganizzePermanentRecords
|
|
109
110
|
return self unless is_permanent?
|
110
111
|
record = self.class
|
111
112
|
record = record.unscoped if active_record_3?
|
112
|
-
record = record.
|
113
|
+
record = record.with_deleted(id)
|
113
114
|
record.deleted_at = value
|
114
115
|
begin
|
115
116
|
# we call save! instead of update_attribute so an ActiveRecord::RecordInvalid
|