draft_punk 0.2.5 → 0.2.6
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/activerecord_instance_methods.rb +3 -1
- data/lib/draft_punk/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e1f37ab686d6608e3d210de16e50f8874877b86
|
|
4
|
+
data.tar.gz: 9d49ee3b5844090e4f5e602be9777dd6ac41f453
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
data/lib/draft_punk/version.rb
CHANGED
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.
|
|
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-
|
|
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.
|
|
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
|