From 275529446e765cb3c6d1e84bb8c1c8707e1b34a4 Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Tue, 3 May 2011 16:07:25 +0200 Subject: raise an error if the old router draw method is used, along with a message advising them to either upgrade their routes or add rails_legacy_mapper to their Gemfile --- actionpack/lib/action_dispatch/routing/route_set.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/lib/action_dispatch/routing') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 1d09091dc7..963a9107da 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -240,6 +240,11 @@ module ActionDispatch end def eval_block(block) + if block.arity == 1 + raise "You are using the old router DSL which has been removed in Rails 3.1. " << + "Please check how to update your routes file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/ " << + "or add the rails_legacy_mapper gem to your Gemfile" + end mapper = Mapper.new(self) if default_scope mapper.with_default_scope(default_scope, &block) -- cgit v1.2.3