zombie_record 1.1.1 → 1.1.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: 2279da46085c6a22c53a3be53536ea888bb86673
4
- data.tar.gz: f87bba4fbc5bcd4ffe74fceb3cb5996e9c2e702f
3
+ metadata.gz: 5fcd4f52b9d5d55985cfbdbe559120d7893df768
4
+ data.tar.gz: d2349915fe48d65dcd8c67e1a7ff4582023fbe5f
5
5
  SHA512:
6
- metadata.gz: 6cb938c7087b92ff5e53078bfccf991d05bc96f78e22b97d3647461c2907d267e999f84e0c1fe0b366cffe0dd0bee6cd400ab0d8e844710489c780e4b6ac5a75
7
- data.tar.gz: dfa50f92929de5e5e20248c7344b4373551eb89e7b43f0e196a12bdf5d32f568d8bb8348c8e8c71bc98d396e35287f04eb2dba0f862ed779ad56b66141ad05c4
6
+ metadata.gz: b8248ef72aee0d1b52a52559463f31f764a47438892636d60205aa9ac2ac81f747f0cd698074daed3374579d7ee4cc810ff4377e3933937cbd9a158310bc04ad
7
+ data.tar.gz: f3dbf5c2833aedb5996ee75ca47a58e2cdef2f2097e849c2999fc808bd0d0e51039d1863e68a2e34ffc9c686764720da97ab589fa76aa664c6f952e4243114e5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ###### Unreleased
2
2
 
3
+ ###### v1.1.2
4
+
5
+ * Fewer queries when soft deleting.
6
+
3
7
  ###### v1.1.1
4
8
 
5
9
  * Test against Rails 4.2.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- zombie_record (1.1.1)
4
+ zombie_record (1.1.2)
5
5
  activerecord (~> 4.0)
6
6
  mysql2
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- zombie_record (1.1.1)
4
+ zombie_record (1.1.2)
5
5
  activerecord (~> 4.0)
6
6
  mysql2
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- zombie_record (1.1.1)
4
+ zombie_record (1.1.2)
5
5
  activerecord (~> 4.0)
6
6
  mysql2
7
7
 
@@ -54,11 +54,13 @@ module ZombieRecord
54
54
  # Override Rails' #destroy_row for soft-delete functionality
55
55
  def destroy_row
56
56
  time = current_time_from_proper_timezone
57
- update_column(:deleted_at, time)
58
57
 
58
+ update_params = { deleted_at: time }
59
59
  if self.class.column_names.include?("updated_at")
60
- update_column(:updated_at, time)
60
+ update_params[:updated_at] = time
61
61
  end
62
+
63
+ update_columns(update_params)
62
64
  end
63
65
 
64
66
  def restore_associated_records!
@@ -1,3 +1,3 @@
1
1
  module ZombieRecord
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["dasch@zendesk.com"]
11
11
  spec.description = %q{Allows restoring your Active Records from the dead!}
12
12
  spec.summary = %q{Allows restoring your Active Records from the dead!}
13
- spec.homepage = "https://github.com/dasch/zombie_record"
13
+ spec.homepage = "https://github.com/zendesk/zombie_record"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zombie_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-02 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -149,7 +149,7 @@ files:
149
149
  - spec/restorable_spec.rb
150
150
  - spec/spec_helper.rb
151
151
  - zombie_record.gemspec
152
- homepage: https://github.com/dasch/zombie_record
152
+ homepage: https://github.com/zendesk/zombie_record
153
153
  licenses:
154
154
  - MIT
155
155
  metadata: {}
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.2.2
172
+ rubygems_version: 2.4.5
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Allows restoring your Active Records from the dead!