Skip to content

Commit 3d3ae1d

Browse files
Drop support for removed raise_in_transactional_callbacks options
Rails 5 dropped support for the ActiveRecord::Base.raise_in_transactional_callbacks configuration option. Now exceptions in a callback will always raise, and you cannot disable that behavior.
1 parent fe0ecad commit 3d3ae1d

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

spec/when_committed_spec.rb

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
end
1919
end
2020

21-
before(:each) do
22-
# Make sure exceptions aren't swallowed in tests
23-
ActiveRecord::Base.raise_in_transactional_callbacks = true
24-
end
25-
2621
it "provides a #when_committed method" do
2722
sample_class = Sample
2823
model = sample_class.new
@@ -185,27 +180,7 @@
185180
end
186181

187182
context "when a previous callback raised an exception" do
188-
it "still runs the block if raise_in_transactional_callbacks is false" do
189-
ActiveRecord::Base.raise_in_transactional_callbacks = false
190-
191-
w1 = Widget.new
192-
w2 = Widget.new
193-
w3 = Widget.new
194-
w4 = Widget.new
195-
196-
Widget.transaction do
197-
w1.when_committed { Backgrounder.enqueue :first }
198-
w2.when_committed { raise Catastrophe }
199-
w3.when_committed { Backgrounder.enqueue :third }
200-
w4.when_committed { Backgrounder.enqueue :fourth }
201-
end
202-
203-
Backgrounder.jobs.should == [:first, :third, :fourth]
204-
end
205-
206-
it "does not run the block if raise_in_transactional_callbacks is true" do
207-
ActiveRecord::Base.raise_in_transactional_callbacks = true
208-
183+
it "does not run the block" do
209184
w1 = Widget.new
210185
w2 = Widget.new
211186
w3 = Widget.new

0 commit comments

Comments
 (0)