removes the compatibility method Module#instance_method_names

This commit is contained in:
Xavier Noria 2011-12-25 11:02:42 -08:00
parent 4e1999d20e
commit 40bda76067
4 changed files with 7 additions and 15 deletions

View File

@ -5,7 +5,6 @@ require 'action_view/helpers/form_tag_helper'
require 'action_view/helpers/active_model_helper'
require 'active_support/core_ext/class/attribute'
require 'active_support/core_ext/hash/slice'
require 'active_support/core_ext/module/method_names'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/string/output_safety'
require 'active_support/core_ext/array/extract_options'
@ -1232,7 +1231,7 @@ module ActionView
class FormBuilder
# The methods which wrap a form helper call.
class_attribute :field_helpers
self.field_helpers = FormHelper.instance_method_names - %w(form_for convert_to_model)
self.field_helpers = FormHelper.instance_methods - [:form_for, :convert_to_model]
attr_accessor :object_name, :object, :options

View File

@ -1,7 +1,10 @@
## Rails 4.0.0 (unreleased) ##
* BufferedLogger is deprecated. Use ActiveSupport::Logger, or the logger
from Ruby stdlib.
* Deletes the compatibility method Module#instance_method_names,
use Module#instance_methods from now on (which returns symbols). *fxn*
* BufferedLogger is deprecated. Use ActiveSupport::Logger, or the logger
from Ruby stdlib.
## Rails 3.2.0 (unreleased) ##

View File

@ -1,8 +1,4 @@
class Module
def instance_method_names(*args)
instance_methods(*args).map { |name| name.to_s }
end
def method_names(*args)
methods(*args).map { |name| name.to_s }
end

View File

@ -937,13 +937,7 @@ NOTE: Defined in +active_support/core_ext/module/delegation.rb+
h4. Method Names
The builtin methods +instance_methods+ and +methods+ return method names as strings or symbols depending on the Ruby version. Active Support defines +instance_method_names+ and +method_names+ to be equivalent to them, respectively, but always getting strings back.
For example, +ActionView::Helpers::FormBuilder+ knows this array difference is going to work no matter the Ruby version:
<ruby>
self.field_helpers = (FormHelper.instance_method_names - ['form_for'])
</ruby>
The builtin method +methods+ returns method names as strings or symbols depending on the Ruby version. Active Support defines +method_names+ to be equivalent, but always getting strings back.
NOTE: Defined in +active_support/core_ext/module/method_names.rb+