active_interaction 1.2.2 → 1.2.3

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: 8da6c6009b0e73aeec0afbc524e94c27dde01260
4
- data.tar.gz: c34f2110a50219b87ba1e22cda387f0f429db7d2
3
+ metadata.gz: 6ba88eafd8b605090eafd610e1b9b4e41638e5b8
4
+ data.tar.gz: 44de977111bd36c6348864c0024ff886d71022c5
5
5
  SHA512:
6
- metadata.gz: 274c345305f246fc6ae9078846d317cbb7e19b4781d18e73f20ade3336ca77f34008e7e8ca65985a5b3573a0742d8c79a25e9c1ffcc707d947ee5316e965fcec
7
- data.tar.gz: ff0bf22dfb87c3774a3a9397943dfa02959355b7773dd87d1d188ac7ac1df47a6014888fcba67ef1286200f6df93f98e96c008c3acf0234d0c87f83780e0464e
6
+ metadata.gz: 1befd803a782dfe60b5c058f49b3e670e2f4b8d4d5434b15e81acdb7564ab803812dcce8172c615fe0bc04f7a8be7576615f02b9183d8d3a9c8776f77f2c6a92
7
+ data.tar.gz: ced6bb16015b351c6d4555feb91d84f82ed4e62f3cb9ca650c9ac7c3be9d2f7edcf29f94a84aef6e24fe58572b41de52565bf4c436d3db534e48758cfc39f286
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # [Master][]
2
2
 
3
+ # [1.2.3][] (2014-05-12)
4
+
5
+ - Fix a bug that raised `ActiveRecord::Rollback` when composing even when not
6
+ in a transaction.
7
+
3
8
  # [1.2.2][] (2014-05-07)
4
9
 
5
10
  - Fix a bug that raised `NameError`s when there were invalid nested hash
@@ -205,7 +210,8 @@
205
210
 
206
211
  - Initial release.
207
212
 
208
- [master]: https://github.com/orgsync/active_interaction/compare/v1.2.2...master
213
+ [master]: https://github.com/orgsync/active_interaction/compare/v1.2.3...master
214
+ [1.2.3]: https://github.com/orgsync/active_interaction/compare/v1.2.2...v1.2.3
209
215
  [1.2.2]: https://github.com/orgsync/active_interaction/compare/v1.2.1...v1.2.2
210
216
  [1.2.1]: https://github.com/orgsync/active_interaction/compare/v1.2.0...v1.2.1
211
217
  [1.2.0]: https://github.com/orgsync/active_interaction/compare/v1.1.7...v1.2.0
@@ -50,5 +50,5 @@ I18n.default_locale = :en
50
50
  #
51
51
  # @since 1.0.0
52
52
  #
53
- # @version 1.2.2
53
+ # @version 1.2.3
54
54
  module ActiveInteraction end
@@ -88,7 +88,7 @@ module ActiveInteraction
88
88
  rescue Interrupt => interrupt
89
89
  merge_errors_onto_base(interrupt.outcome.errors)
90
90
 
91
- raise ActiveRecord::Rollback
91
+ raise ActiveRecord::Rollback if self.class.transaction?
92
92
  end
93
93
  end
94
94
  end
@@ -5,5 +5,5 @@ module ActiveInteraction
5
5
  # The version number.
6
6
  #
7
7
  # @return [Gem::Version]
8
- VERSION = Gem::Version.new('1.2.2')
8
+ VERSION = Gem::Version.new('1.2.3')
9
9
  end
@@ -179,12 +179,11 @@ describe ActiveInteraction::Runnable do
179
179
 
180
180
  context 'with an execute where composition fails' do
181
181
  before do
182
- CompositionFailure = Class.new(ActiveInteraction::Base) do
182
+ interaction = Class.new(TestInteraction) do
183
183
  validate { errors.add(:base) }
184
- def execute; end
185
184
  end
186
185
 
187
- klass.send(:define_method, :execute) { compose(CompositionFailure) }
186
+ klass.send(:define_method, :execute) { compose(interaction) }
188
187
  end
189
188
 
190
189
  it 'rolls back the transaction' do
@@ -195,6 +194,19 @@ describe ActiveInteraction::Runnable do
195
194
  expect(instance).to have_received(:raise)
196
195
  .with(ActiveRecord::Rollback)
197
196
  end
197
+
198
+ context 'without a transaction' do
199
+ before { klass.transaction(false) }
200
+
201
+ it 'does not roll back' do
202
+ instance = klass.new
203
+
204
+ allow(instance).to receive(:raise)
205
+ instance.send(:run)
206
+ expect(instance).to_not have_received(:raise)
207
+ .with(ActiveRecord::Rollback)
208
+ end
209
+ end
198
210
  end
199
211
 
200
212
  context 'with invalid post-execution state' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_interaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-07 00:00:00.000000000 Z
12
+ date: 2014-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel