Permalink
Browse files

Fix method redefined warning message in mapper.rb

  • Loading branch information...
pixeltrix committed Dec 29, 2013
1 parent 15e2eb4 commit 54ccc58c6208601a5714cff1b05418979656bf22
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -3,6 +3,7 @@
require 'active_support/core_ext/hash/slice'
require 'active_support/core_ext/enumerable'
require 'active_support/core_ext/array/extract_options'
+require 'active_support/core_ext/module/remove_method'
require 'active_support/inflector'
require 'action_dispatch/routing/redirection'
@@ -546,11 +547,11 @@ def define_generate_prefix(app, name)
_routes = @set
app.routes.define_mounted_helper(name)
app.routes.singleton_class.class_eval do
- define_method :mounted? do
+ redefine_method :mounted? do
true
end
- define_method :_generate_prefix do |options|
+ redefine_method :_generate_prefix do |options|
prefix_options = options.slice(*_route.segment_keys)
# we must actually delete prefix segment keys to avoid passing them to next url_for
_route.segment_keys.each { |k| options.delete(k) }

0 comments on commit 54ccc58

Please sign in to comment.