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:
parent
028f91277d
commit
c9bbac46dd
2 changed files with 4 additions and 16 deletions
|
@ -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`.
|
* Remove deprecated `DateTime.local_offset` in favor of `DateTime.civil_from_fromat`.
|
||||||
|
|
||||||
*Arun Agrawal*
|
*Arun Agrawal*
|
||||||
|
|
|
@ -59,20 +59,4 @@ class Module
|
||||||
def local_constants #:nodoc:
|
def local_constants #:nodoc:
|
||||||
constants(false)
|
constants(false)
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue