culturecode_stagehand 0.15.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stagehand/active_record_extensions.rb +6 -0
- data/lib/stagehand/database.rb +1 -1
- data/lib/stagehand/staging/commit.rb +9 -4
- data/lib/stagehand/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fdc23b385dbb657b54cb029e4714657b4aa3e69
|
4
|
+
data.tar.gz: bdbd449b63397e6a68e223616d1ee6f7ce737c58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87fb81e17c7fb2837b9217bc7cda6758b1694667f1b5b0a97da5b75bb0c512fe2a695d2ee44768d8e3ceb275d07f222453d7eb79ad69dd98426156df021f4cbe
|
7
|
+
data.tar.gz: ab28c8a9ab9cc625c30a573c17c2e4043d9498aef2f9cf90e01bcba2ed9d68d91c0d1708d59f2df27905cf6644617e1e99a6bd41d626d1ff7902f32209db7662
|
data/lib/stagehand/database.rb
CHANGED
@@ -50,7 +50,7 @@ module Stagehand
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def with_connection(connection_name)
|
53
|
-
different =
|
53
|
+
different = current_connection_name != connection_name.to_sym
|
54
54
|
|
55
55
|
if different
|
56
56
|
@@connection_name_stack.push(connection_name.to_sym)
|
@@ -21,7 +21,7 @@ module Stagehand
|
|
21
21
|
begin
|
22
22
|
block.call(start_operation)
|
23
23
|
rescue => e
|
24
|
-
end_commit(start_operation, except)
|
24
|
+
end_commit(start_operation, except) unless e.is_a?(CommitError)
|
25
25
|
raise(e)
|
26
26
|
else
|
27
27
|
return end_commit(start_operation, except)
|
@@ -50,7 +50,10 @@ module Stagehand
|
|
50
50
|
|
51
51
|
# Make it easy to set the subject for the duration of the commit block
|
52
52
|
def start_operation.subject=(record)
|
53
|
-
|
53
|
+
if record&.id
|
54
|
+
raise NonStagehandSubject unless record.has_stagehand?
|
55
|
+
self.assign_attributes :record_id => record.id, :table_name => record.class.table_name
|
56
|
+
end
|
54
57
|
save!
|
55
58
|
end
|
56
59
|
|
@@ -137,6 +140,8 @@ module Stagehand
|
|
137
140
|
end
|
138
141
|
|
139
142
|
# EXCEPTIONS
|
140
|
-
class
|
141
|
-
class
|
143
|
+
class CommitError < StandardError; end
|
144
|
+
class CommitNotFound < CommitError; end
|
145
|
+
class BlankCommitEntrySession < CommitError; end
|
146
|
+
class NonStagehandSubject < CommitError; end
|
142
147
|
end
|
data/lib/stagehand/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: culturecode_stagehand
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Jakobsen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-11-
|
12
|
+
date: 2017-11-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|