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

Remove deprecated Module#local_constant_names

in favor of `Module#local_constants`
This commit is contained in:
Arun Agrawal 2013-07-03 19:42:34 +02:00
parent 028f91277d
commit c9bbac46dd
2 changed files with 4 additions and 16 deletions

View file

@ -1,3 +1,7 @@
* Remove deprecated `Module#local_constant_names` in favor of `Module#local_constants`.
*Arun Agrawal*
* Remove deprecated `DateTime.local_offset` in favor of `DateTime.civil_from_fromat`.
*Arun Agrawal*

View file

@ -59,20 +59,4 @@ class Module
def local_constants #:nodoc:
constants(false)
end
# *DEPRECATED*: Use +local_constants+ instead.
#
# Returns the names of the constants defined locally as strings.
#
# module M
# X = 1
# end
# M.local_constant_names # => ["X"]
#
# This method is useful for forward compatibility, since Ruby 1.8 returns
# constant names as strings, whereas 1.9 returns them as symbols.
def local_constant_names
ActiveSupport::Deprecation.warn 'Module#local_constant_names is deprecated, use Module#local_constants instead'
local_constants.map { |c| c.to_s }
end
end