Fix indentation
This commit is contained in:
parent
5b4b632358
commit
d7b5a374c2
|
@ -32,7 +32,7 @@ module TransactionHelper
|
||||||
|
|
||||||
def self.after_commit(&blk)
|
def self.after_commit(&blk)
|
||||||
ActiveRecord::Base.connection.add_transaction_record(
|
ActiveRecord::Base.connection.add_transaction_record(
|
||||||
AfterCommitWrapper.new(&blk)
|
AfterCommitWrapper.new(&blk)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,28 +5,28 @@ describe TransactionHelper do
|
||||||
it "runs callbacks after outermost transaction is committed" do
|
it "runs callbacks after outermost transaction is committed" do
|
||||||
outputString = "1"
|
outputString = "1"
|
||||||
|
|
||||||
# Main transaction
|
# Main transaction
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
outputString += "2"
|
outputString += "2"
|
||||||
|
|
||||||
# Nested transaction
|
# Nested transaction
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
outputString += "3"
|
outputString += "3"
|
||||||
|
|
||||||
TransactionHelper.after_commit do
|
TransactionHelper.after_commit do
|
||||||
outputString += "6"
|
outputString += "6"
|
||||||
end
|
end
|
||||||
outputString += "4"
|
outputString += "4"
|
||||||
end
|
end
|
||||||
|
|
||||||
TransactionHelper.after_commit do
|
TransactionHelper.after_commit do
|
||||||
outputString += "7"
|
outputString += "7"
|
||||||
end
|
end
|
||||||
|
|
||||||
outputString += "5"
|
outputString += "5"
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(outputString).to eq("1234567")
|
expect(outputString).to eq("1234567")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue