remove the mounted? method

we know the routes should not be "optimized" when mounting an
application
This commit is contained in:
Aaron Patterson 2014-07-28 14:07:53 -07:00
parent 099fd0efc4
commit 9f63a78d55
2 changed files with 2 additions and 6 deletions

View File

@ -621,7 +621,7 @@ module ActionDispatch
_routes = @set
app.routes.define_mounted_helper(name)
app.routes.extend Module.new {
def mounted?; true; end
def optimize_routes_generation?; false; end
define_method :find_script_name do |options|
super(options) || begin
prefix_options = options.slice(*_route.segment_keys)

View File

@ -641,12 +641,8 @@ module ActionDispatch
:trailing_slash, :anchor, :params, :only_path, :script_name,
:original_script_name]
def mounted?
false
end
def optimize_routes_generation?
!mounted? && default_url_options.empty?
default_url_options.empty?
end
def find_script_name(options)