mirror of https://github.com/rails/rails
make zones_map private
Conflicts: activesupport/lib/active_support/values/time_zone.rb
This commit is contained in:
parent
cdd3961e2b
commit
89d48fb342
|
@ -224,13 +224,6 @@ module ActiveSupport
|
||||||
@zones ||= zones_map.values.sort
|
@zones ||= zones_map.values.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def zones_map
|
|
||||||
@zones_map ||= begin
|
|
||||||
MAPPING.each_key {|place| self[place]} # load all the zones
|
|
||||||
@lazy_zones_map
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Locate a specific time zone object. If the argument is a string, it
|
# Locate a specific time zone object. If the argument is a string, it
|
||||||
# is interpreted to mean the name of the timezone to locate. If it is a
|
# is interpreted to mean the name of the timezone to locate. If it is a
|
||||||
# numeric value it is either the hour offset, or the second offset, of the
|
# numeric value it is either the hour offset, or the second offset, of the
|
||||||
|
@ -257,6 +250,14 @@ module ActiveSupport
|
||||||
def us_zones
|
def us_zones
|
||||||
@us_zones ||= all.find_all { |z| z.name =~ /US|Arizona|Indiana|Hawaii|Alaska/ }
|
@us_zones ||= all.find_all { |z| z.name =~ /US|Arizona|Indiana|Hawaii|Alaska/ }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def zones_map
|
||||||
|
@zones_map ||= begin
|
||||||
|
MAPPING.each_key {|place| self[place]} # load all the zones
|
||||||
|
@lazy_zones_map
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
include Comparable
|
include Comparable
|
||||||
|
|
|
@ -402,8 +402,7 @@ class TimeZoneTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_unknown_zones_dont_store_mapping_keys
|
def test_unknown_zones_dont_store_mapping_keys
|
||||||
ActiveSupport::TimeZone["bogus"]
|
assert_nil ActiveSupport::TimeZone["bogus"]
|
||||||
assert !ActiveSupport::TimeZone.zones_map.key?("bogus")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_new
|
def test_new
|
||||||
|
|
Loading…
Reference in New Issue