purgatory 4.0.0 → 6.0.1
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/VERSION +1 -1
- data/lib/purgatory/purgatory.rb +16 -12
- data/purgatory.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1583114c3324345ef6ace121844c2dbc67769d92982acfe17b6e96239d8d745
|
4
|
+
data.tar.gz: dff5194db0354ac30037530e6d007291db0adf30a01fc950e2d75f13990cd5fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f354e1057db8afa43f520c1c58658f0bb04fadc5b4ec63a972d733691bddc1673b30f010cbadfa7f857d0dbf0ab61796c9b1803c6e29d679e816e091a77c35f7
|
7
|
+
data.tar.gz: afb6c2f8af9874ab2ae52dc76174eec87c5fd97869ece5c2fabd3bbc4eb49f6b904de905d45766444b58b3f3e0a9f6b1e1c086836b10bed2b61d4fc62189a31b
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6.0.1
|
data/lib/purgatory/purgatory.rb
CHANGED
@@ -44,22 +44,26 @@ class Purgatory < ActiveRecord::Base
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def approve!(approver = nil)
|
47
|
+
return false if approved?
|
48
|
+
|
49
|
+
success = nil
|
47
50
|
self.with_lock do
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
unless approved?
|
52
|
+
success = soul_with_changes.save
|
53
|
+
if performable_method.present? && success
|
54
|
+
success = soul.send(performable_method[:method], *performable_method[:args])
|
55
|
+
end
|
53
56
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
if success
|
58
|
+
self.approver = approver
|
59
|
+
self.approved_at = Time.now
|
60
|
+
self.soul_id = soul.id
|
61
|
+
save
|
62
|
+
end
|
60
63
|
end
|
61
|
-
false
|
62
64
|
end
|
65
|
+
|
66
|
+
success
|
63
67
|
end
|
64
68
|
|
65
69
|
def self.pending_with_matching_soul(soul)
|
data/purgatory.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: purgatory
|
2
|
+
# stub: purgatory 6.0.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "purgatory"
|
6
|
-
s.version = "
|
6
|
+
s.version = "6.0.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: purgatory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elan Dubrofsky
|
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
63
|
version: '0'
|
64
64
|
requirements: []
|
65
65
|
rubyforge_project:
|
66
|
-
rubygems_version: 2.7.
|
66
|
+
rubygems_version: 2.7.6.2
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: Allow changes to a model to be put in purgatory until they are approved
|