Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Do not check defined?(CGI) on every call #to_query

  • Loading branch information...
commit f1798951e747da23bd1f30a7f1a6c041a117bd8a 1 parent c6c1642
@printercu printercu authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activesupport/lib/active_support/core_ext/object/to_query.rb
View
2  activesupport/lib/active_support/core_ext/object/to_query.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/object/to_param'
+require 'cgi'
class Object
# Converts an object into a string suitable for use as a URL query string, using the given <tt>key</tt> as the
@@ -6,7 +7,6 @@ class Object
#
# Note: This method is defined as a default implementation for all Objects for Hash#to_query to work.
def to_query(key)
- require 'cgi' unless defined?(CGI) && defined?(CGI::escape)
"#{CGI.escape(key.to_param)}=#{CGI.escape(to_param.to_s)}"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.