sequel-paranoid 0.6.1 → 0.6.2
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.
- checksums.yaml +4 -4
- data/lib/sequel/plugins/paranoid.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00ea7005b5cef0b88e4dd80e5592dd83b55ec5ee
|
4
|
+
data.tar.gz: 0754305ae29e1968e0cf9dba290d798e00a1ec1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d1c1864e7b354a34bfdaef9c082da089f141e642c0f68ee91e1437a9c875d6f7f3509f862dcbb98f61092e9a23d674276e35dd709f78d5d21c30b7ff8fc7086
|
7
|
+
data.tar.gz: c80715773eda084fc7479794f10b528dfbbbb48696d73cda96de8be8932cb06a9f177d233b6c1b80299afd7a004f3cc3dc9230acf76d33829847b6fcaecb62fa
|
@@ -65,6 +65,23 @@ module Sequel::Plugins
|
|
65
65
|
self.save
|
66
66
|
end
|
67
67
|
|
68
|
+
#
|
69
|
+
# Sequel patch to allow updates to deleted instances
|
70
|
+
# when default scope is enabled
|
71
|
+
#
|
72
|
+
|
73
|
+
define_method("_update_without_checking") do |columns|
|
74
|
+
# figure out correct pk conditions (see base#this)
|
75
|
+
conditions = this.send(:joined_dataset?) ? qualified_pk_hash : pk_hash
|
76
|
+
|
77
|
+
# turn off with deleted, added the pk conditions back in
|
78
|
+
update_with_deleted_dataset = this.with_deleted.where(conditions)
|
79
|
+
|
80
|
+
# run the original update on the with_deleted dataset
|
81
|
+
update_with_deleted_dataset.update(columns)
|
82
|
+
|
83
|
+
end if(options[:enable_default_scope])
|
84
|
+
|
68
85
|
#
|
69
86
|
# Method for undeleting an instance.
|
70
87
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-paranoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sascha Depold
|
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
version: '0'
|
53
53
|
requirements: []
|
54
54
|
rubyforge_project:
|
55
|
-
rubygems_version: 2.4.5
|
55
|
+
rubygems_version: 2.4.5.1
|
56
56
|
signing_key:
|
57
57
|
specification_version: 4
|
58
58
|
summary: A plugin for the Ruby ORM Sequel, that allows soft deletion of database entries.
|