Permalink
Browse files

eval_block should be private

  • Loading branch information...
tenderlove committed Jul 29, 2014
1 parent a240ad0 commit d2d33769030b3a560bdbc9c33e7c189274a0dc3a
Showing with 1 addition and 0 deletions.
  1. +1 −0 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -334,6 +334,7 @@ def eval_block(block)
mapper.instance_exec(&block)
end
end
+ private :eval_block
def finalize!
return if @finalized

3 comments on commit d2d3376

@tenderlove I used this method to add fake routes to my tests:

test_routes = Proc.new do
  ...
end

Rails.application.routes.eval_block(test_routes)

Any alternatives now that eval_block is private?

@ggarnier try Rails.application.routes.draw:

Rails.application.routes.draw do
  resources :foos
end

If you want to keep all your other routes, set this first:

Rails.application.routes.disable_clear_and_finalize = true
Please sign in to comment.