From 15c2a5be6e326614e0952630166a35f6f7404312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 11 Jun 2014 17:10:26 -0300 Subject: Revert "remove unnecssary require of `to_param`, as `to_query` is already require `to_param`" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "No need to require to_param, it is already required in to_query.rb" This reverts commits ccdd97662e1fb00c23c90d59f65c091904959561 and d697ee14264a90a39cdbe87857656d8b314ac9b7. Reason by @jeremy: These requires are not for implementation dependency. They ensure that requiring array conversions provides to_query, to_param, and other array conversion behaviors. The fact that to_query is implemented in terms of to_param is just a coincidence. If to_query removed its to_param require, then someone requiring array conversions would no longer have to_param available. This change removes these intentional dependencies on to_param in favor of implementation side effects—an undesirable move that's susceptible to regression. --- activesupport/lib/active_support/core_ext/array/conversions.rb | 1 + activesupport/lib/active_support/core_ext/hash/conversions.rb | 1 + activesupport/lib/active_support/core_ext/object.rb | 1 + activesupport/lib/active_support/core_ext/object/conversions.rb | 1 + 4 files changed, 4 insertions(+) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb index 6b632022c2..76ffd23ed1 100644 --- a/activesupport/lib/active_support/core_ext/array/conversions.rb +++ b/activesupport/lib/active_support/core_ext/array/conversions.rb @@ -1,6 +1,7 @@ require 'active_support/xml_mini' require 'active_support/core_ext/hash/keys' require 'active_support/core_ext/string/inflections' +require 'active_support/core_ext/object/to_param' require 'active_support/core_ext/object/to_query' class Array diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb index 5e86d9443e..2149d4439d 100644 --- a/activesupport/lib/active_support/core_ext/hash/conversions.rb +++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb @@ -1,6 +1,7 @@ require 'active_support/xml_mini' require 'active_support/time' require 'active_support/core_ext/object/blank' +require 'active_support/core_ext/object/to_param' require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/hash/reverse_merge' diff --git a/activesupport/lib/active_support/core_ext/object.rb b/activesupport/lib/active_support/core_ext/object.rb index 12d17a42c2..f4f9152d6a 100644 --- a/activesupport/lib/active_support/core_ext/object.rb +++ b/activesupport/lib/active_support/core_ext/object.rb @@ -9,5 +9,6 @@ require 'active_support/core_ext/object/conversions' require 'active_support/core_ext/object/instance_variables' require 'active_support/core_ext/object/json' +require 'active_support/core_ext/object/to_param' require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/object/with_options' diff --git a/activesupport/lib/active_support/core_ext/object/conversions.rb b/activesupport/lib/active_support/core_ext/object/conversions.rb index 3cd3c88a28..540f7aadb0 100644 --- a/activesupport/lib/active_support/core_ext/object/conversions.rb +++ b/activesupport/lib/active_support/core_ext/object/conversions.rb @@ -1,3 +1,4 @@ +require 'active_support/core_ext/object/to_param' require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/array/conversions' require 'active_support/core_ext/hash/conversions' -- cgit v1.2.3