1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "remove unnecssary require of to_param, as to_query is already require to_param"

Revert "No need to require to_param, it is already required in to_query.rb"

This reverts commits ccdd97662e
and d697ee1426.

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.
This commit is contained in:
Rafael Mendonça França 2014-06-11 17:10:26 -03:00
parent 168dc1968c
commit 15c2a5be6e
4 changed files with 4 additions and 0 deletions

View file

@ -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

View file

@ -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'

View file

@ -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'

View file

@ -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'