Permalink
Browse files

Added check for :only_path around url_for alias method code and bumpe…

…d version.
  • Loading branch information...
1 parent daf54d0 commit 6d82759aa2ec69f970a14ffb73edeaf12f6acee8 @cedric cedric committed Aug 25, 2011
Showing with 11 additions and 9 deletions.
  1. +10 −8 lib/ssl_routes/rails3.rb
  2. +1 −1 lib/ssl_routes/version.rb
View
@@ -62,14 +62,16 @@ def self.included(base)
module InstanceMethods
def url_for_with_ssl_support(options)
- ac = self.respond_to?(:controller) ? self.controller : self
- if ac.enable_ssl
- case options
- when Hash
- current, target = ac.determine_protocols(options)
- if current != target
- options.merge!({ :protocol => target, :only_path => false })
- end
+ if options[:only_path] == true
+ ac = self.respond_to?(:controller) ? self.controller : self
+ if ac.respond_to?(:enable_ssl) && ac.enable_ssl
+ case options
+ when Hash
+ current, target = ac.determine_protocols(options)
+ if current != target
+ options.merge!({ :protocol => target, :only_path => false })
+ end
+ end
end
end
url_for_without_ssl_support(options)
@@ -1,5 +1,5 @@
module SslRoutes
- VERSION = '0.1.1'
+ VERSION = '0.1.2'
end

0 comments on commit 6d82759

Please sign in to comment.