diff options
author | Brian McManus <bdmac97@gmail.com> | 2013-02-19 17:51:23 -0800 |
---|---|---|
committer | Brian McManus <bdmac97@gmail.com> | 2013-02-19 17:51:23 -0800 |
commit | 5c73f0d398d2a7ed955040e580374e92d6536283 (patch) | |
tree | 126801472c03708f0994b065c97075d0ea22587f /actionpack/lib/action_view | |
parent | c2c203c852cea1246ffe77430c6b61c2d4c0f75a (diff) | |
download | rails-5c73f0d398d2a7ed955040e580374e92d6536283.tar.gz rails-5c73f0d398d2a7ed955040e580374e92d6536283.tar.bz2 rails-5c73f0d398d2a7ed955040e580374e92d6536283.zip |
Fix time_zone_options_for_select to not mutate TimeZones array
Previous implementation of time_zone_options_for_select did not dup the
ActiveSupport::TimeZone.all array. When :priority_zones were provided
the method would reject! the zones from the memoized TimeZones array
thus affecting future requests to the server. Essentially whatever
zones were specified as :priority_zones would show up for the first
request but then disappear from the time zone options on future
requests.
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 8b3a37a853..49473dd129 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -560,7 +560,7 @@ module ActionView def time_zone_options_for_select(selected = nil, priority_zones = nil, model = ::ActiveSupport::TimeZone) zone_options = "".html_safe - zones = model.all + zones = model.all.dup convert_zones = lambda { |list| list.map { |z| [ z.to_s, z.name ] } } if priority_zones |