aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/date_helper.rb
diff options
context:
space:
mode:
authorPat Allan <pat@freelancing-gods.com>2017-06-20 22:20:04 +1000
committerPat Allan <pat@freelancing-gods.com>2017-06-20 22:20:04 +1000
commit3d453b409d037a056d0bcd636a2e020cc7cef4a8 (patch)
tree2b1bc8943f5b064fb74e2d7022a882547c82c21f /actionview/lib/action_view/helpers/date_helper.rb
parentdd491b24ff28f637b1c8879002adb1acdf20a8ac (diff)
downloadrails-3d453b409d037a056d0bcd636a2e020cc7cef4a8.tar.gz
rails-3d453b409d037a056d0bcd636a2e020cc7cef4a8.tar.bz2
rails-3d453b409d037a056d0bcd636a2e020cc7cef4a8.zip
Make ActionView frozen string literal friendly.
Plus a couple of related ActionPack patches.
Diffstat (limited to 'actionview/lib/action_view/helpers/date_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/date_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb
index 3f43465aa4..d28eec88a1 100644
--- a/actionview/lib/action_view/helpers/date_helper.rb
+++ b/actionview/lib/action_view/helpers/date_helper.rb
@@ -1007,7 +1007,7 @@ module ActionView
select_options[:disabled] = "disabled" if @options[:disabled]
select_options[:class] = css_class_attribute(type, select_options[:class], @options[:with_css_classes]) if @options[:with_css_classes]
- select_html = "\n"
+ select_html = "\n".dup
select_html << content_tag("option".freeze, "", value: "") + "\n" if @options[:include_blank]
select_html << prompt_option_tag(type, @options[:prompt]) + "\n" if @options[:prompt]
select_html << select_options_as_html
@@ -1089,7 +1089,7 @@ module ActionView
# Given an ordering of datetime components, create the selection HTML
# and join them with their appropriate separators.
def build_selects_from_types(order)
- select = ""
+ select = "".dup
first_visible = order.find { |type| !@options[:"discard_#{type}"] }
order.reverse_each do |type|
separator = separator(type) unless type == first_visible # don't add before first visible field