aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-03 17:17:16 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-04 11:58:42 -0300
commitd282125a18c1697a9b5bb775628a2db239142ac7 (patch)
tree417ae772b2eb01111dcbe6c83674f19bab9ba7ca /actionpack
parent2cc91c37bc2e32b7a04b2d782fb8f4a69a14503f (diff)
downloadrails-d282125a18c1697a9b5bb775628a2db239142ac7.tar.gz
rails-d282125a18c1697a9b5bb775628a2db239142ac7.tar.bz2
rails-d282125a18c1697a9b5bb775628a2db239142ac7.zip
Remove deprecate `*_path` helpers in email views
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb29
-rw-r--r--actionpack/test/routing/helper_test.rb14
2 files changed, 4 insertions, 39 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 0e9e44432c..3f1793b405 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -87,7 +87,7 @@ module ActionDispatch
# named routes.
class NamedRouteCollection #:nodoc:
include Enumerable
- attr_reader :routes, :url_helpers_module
+ attr_reader :routes, :url_helpers_module, :path_helpers_module
def initialize
@routes = {}
@@ -162,25 +162,6 @@ module ActionDispatch
routes.length
end
- def path_helpers_module(warn = false)
- if warn
- mod = @path_helpers_module
- helpers = @path_helpers
- Module.new do
- include mod
-
- helpers.each do |meth|
- define_method(meth) do |*args, &block|
- ActiveSupport::Deprecation.warn("The method `#{meth}` cannot be used here as a full URL is required. Use `#{meth.to_s.sub(/_path$/, '_url')}` instead")
- super(*args, &block)
- end
- end
- end
- else
- @path_helpers_module
- end
- end
-
class UrlHelper # :nodoc:
def self.create(route, options, route_name, url_strategy)
if optimize_helper?(route)
@@ -500,12 +481,10 @@ module ActionDispatch
if supports_path
path_helpers = routes.named_routes.path_helpers_module
- else
- path_helpers = routes.named_routes.path_helpers_module(true)
- end
- include path_helpers
- extend path_helpers
+ include path_helpers
+ extend path_helpers
+ end
# plus a singleton class method called _routes ...
included do
diff --git a/actionpack/test/routing/helper_test.rb b/actionpack/test/routing/helper_test.rb
index 09ca7ff73b..0028aaa629 100644
--- a/actionpack/test/routing/helper_test.rb
+++ b/actionpack/test/routing/helper_test.rb
@@ -26,20 +26,6 @@ module ActionDispatch
x.new.pond_duck_path Duck.new
end
end
-
- def test_path_deprecation
- rs = ::ActionDispatch::Routing::RouteSet.new
- rs.draw do
- resources :ducks
- end
-
- x = Class.new {
- include rs.url_helpers(false)
- }
- assert_deprecated do
- assert_equal '/ducks', x.new.ducks_path
- end
- end
end
end
end