1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use def setup instead of setup do

`setup do` creates unnecessary allocations of proc objects in callbacks.
This prevents that from happening and results in faster code.
This commit is contained in:
eileencodes 2015-03-12 08:23:43 -04:00
parent 9c655f1275
commit 044f9ab7a4

View file

@ -32,13 +32,15 @@ if defined?(ActiveRecord::Base)
end
class ActionController::TestCase
setup do
def setup
@routes = Rails.application.routes
super
end
end
class ActionDispatch::IntegrationTest
setup do
def setup
@routes = Rails.application.routes
super
end
end