aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/transactions_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/transactions_test.rb')
-rw-r--r--activerecord/test/cases/transactions_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 7160e8324d..cf50bd4ddb 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -13,7 +13,7 @@ class TransactionTest < ActiveRecord::TestCase
fixtures :topics, :developers, :authors, :posts
def setup
- @first, @second = Topic.find(1, 2).sort_by { |t| t.id }
+ @first, @second = Topic.find(1, 2).sort_by(&:id)
end
def test_persisted_in_a_model_with_custom_primary_key_after_failed_save
@@ -496,7 +496,7 @@ class TransactionTest < ActiveRecord::TestCase
# The behavior of killed threads having a status of "aborting" was changed
# in Ruby 2.0, so Thread#kill on 1.9 will prematurely commit the transaction
# and there's nothing we can do about it.
- unless RUBY_VERSION.start_with? '1.9'
+ if !RUBY_VERSION.start_with?('1.9') && !in_memory_db?
def test_rollback_when_thread_killed
queue = Queue.new
thread = Thread.new do
@@ -699,7 +699,7 @@ if current_adapter?(:PostgreSQLAdapter)
end
end
- threads.each { |t| t.join }
+ threads.each(&:join)
end
end
@@ -747,7 +747,7 @@ if current_adapter?(:PostgreSQLAdapter)
Developer.connection.close
end
- threads.each { |t| t.join }
+ threads.each(&:join)
end
assert_equal original_salary, Developer.find(1).salary