draft_punk 0.2.5 → 0.2.6

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: 6612bf1ad663d5fc879a40d939cccb2d45c06f02
4
- data.tar.gz: aea192899a505fecb54189e78201daad4f786a0a
3
+ metadata.gz: 2e1f37ab686d6608e3d210de16e50f8874877b86
4
+ data.tar.gz: 9d49ee3b5844090e4f5e602be9777dd6ac41f453
5
5
  SHA512:
6
- metadata.gz: 5f07c766efcc41b6590ceec5ce864960ed9f49384e15fb16477f9ae47240ab1e29ce034f8505286248dada954738f8077aeac42083dc705a01632c25a097320d
7
- data.tar.gz: 5c5cf5a7b23d16b3f83d744f91fa9596bb74ac97f33da9eef76fc82d927fcdca41cd71f59eef2adbcd42de7fe79516a45aef7ffeff13732985f60ea2072cf1f3
6
+ metadata.gz: 689cd3a9c566de8cbf8ab8970f976767ccde62e8de369384739826ab847ddc3dc2b7260351c364081c5b11037a44eeaf51adb25899d69ff29cbee6b22e7b11e3
7
+ data.tar.gz: 42a85f21e29a67b9917b10fb4993967cf3a6028dcd00aa816a9be2035e8c9610c7e08c3b0551f3cd2c092470904a9d15e2077c3feb688a5a2160c76c42cbe349
@@ -63,7 +63,9 @@ module DraftPunk
63
63
  transaction do
64
64
  save_attribute_changes_and_belongs_to_assocations_from_draft
65
65
  update_has_many_and_has_one_associations_from_draft
66
- @live_version.draft.destroy # We have to do this since we moved all the draft's has_many associations to @live_version. If you call "editable_version" later, it'll build the draft.
66
+ # We have to destroy the draft this since we moved all the draft's has_many associations to @live_version. If you call "editable_version" later, it'll build the draft.
67
+ # We destroy_all in case extra drafts are in the database. Extra drafts can potentially be created due to race conditions in the application.
68
+ self.class.unscoped.where(approved_version_id: @live_version.id).destroy_all
67
69
  end
68
70
  @live_version = self.class.find(@live_version.id)
69
71
  end
@@ -1,3 +1,3 @@
1
1
  module DraftPunk
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draft_punk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Hodges
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-18 00:00:00.000000000 Z
11
+ date: 2016-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amoeba
@@ -196,10 +196,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  version: '0'
197
197
  requirements: []
198
198
  rubyforge_project:
199
- rubygems_version: 2.2.2
199
+ rubygems_version: 2.5.1
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Easy editing of a draft version of an ActiveRecord model and its associations,
203
203
  and publishing said draft's changes back to the original models.
204
204
  test_files: []
205
- has_rdoc: yard