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.
@@ -1,3 +1,3 @@
1
1
  module OrganizzePermanentRecords
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -38,12 +38,13 @@ module OrganizzePermanentRecords
38
38
  end
39
39
 
40
40
  module EarlyRails
41
- def with_deleted
42
- with_scope :find => {:conditions => "#{quoted_table_name}.deleted_at IS NOT NULL"} do
43
- yield
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.find(id)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: organizze_permanent_records
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: