aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/date_helper.rb
diff options
context:
space:
mode:
authorChris McGrath <chris@octopod.info>2013-01-17 15:21:26 +0000
committerChris McGrath <chris@octopod.info>2013-01-17 15:21:26 +0000
commit6bb784eab0d286d1966c12e1bacc793113d6fbae (patch)
tree436d9680844b511a16c1ccef6f54671df8f050b3 /actionpack/lib/action_view/helpers/date_helper.rb
parent038574a5385e07f1091e355b78558821e123a48c (diff)
downloadrails-6bb784eab0d286d1966c12e1bacc793113d6fbae.tar.gz
rails-6bb784eab0d286d1966c12e1bacc793113d6fbae.tar.bz2
rails-6bb784eab0d286d1966c12e1bacc793113d6fbae.zip
Remove i18n symbol dependency
date.order is the only key in rails i18n that is required to be a symbol. This patch allows for symbols or strings which means: * No requirement for symbol type in .yml files. A future YAML.safe_load wouldn't need to load symbols * Rails could actually use json rather than yml as the backend
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index cf978d8e83..3af9116135 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -880,6 +880,7 @@ module ActionView
def translated_date_order
date_order = I18n.translate(:'date.order', :locale => @options[:locale], :default => [])
+ date_order.map! { |element| element.to_sym }
forbidden_elements = date_order - [:year, :month, :day]
if forbidden_elements.any?