lib/url_for.rb in bartt-ssl_requirement-1.3.1 vs lib/url_for.rb in bartt-ssl_requirement-1.4.0
- old
+ new
@@ -1,6 +1,7 @@
require 'action_dispatch/routing/route_set'
+require 'active_support/core_ext/module/aliasing'
module ActionDispatch
module Routing
class RouteSet
@@ -42,9 +43,12 @@
end
url_for_without_non_ssl_host(options)
end
# want with_secure_option to get run first (so chain it last)
+ # Can't use method overriding using modules as RoutSet#url_for is defined directly in
+ # the class and not in a (Base) module. See http://stackoverflow.com/questions/3689736/rails-3-alias-method-chain-still-used
+ # for a good discussion.
alias_method_chain :url_for, :non_ssl_host
alias_method_chain :url_for, :secure_option
end
end
end