sequel-paranoid 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0169362a1eb1a05abec4c406222b63f2a06c0803
4
- data.tar.gz: f9ce63def94d19e2dc9bb7e595f110f993ca6134
3
+ metadata.gz: 00ea7005b5cef0b88e4dd80e5592dd83b55ec5ee
4
+ data.tar.gz: 0754305ae29e1968e0cf9dba290d798e00a1ec1a
5
5
  SHA512:
6
- metadata.gz: 3a8cbcc3a9bf3e0bf35bc973c3dbb398c819d3a25aeea591212bff8313db4d27e863cdd9cfd5618fe64d9bafd227705e98b676091301bb190f93aaca4781005e
7
- data.tar.gz: e2f01429053753c721603e9233d976c3417513008d0f77c43fffc97d17a35e80fa98ab852c7d86655393b6f5204d27d06431c1d10f3fc099816082743b11d49f
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.1
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.