aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2018-04-06 11:50:04 +0100
committerAndrew White <andrew.white@unboxed.co>2018-04-06 11:50:04 +0100
commit457312f54fc1641ad42bcc6362b13836fc30feec (patch)
tree2b86f48015f1ff50d211781eeafb0e08cd8d7cbb
parentd514ce9199fac58e569482dc901e53d0526abdf7 (diff)
downloadrails-457312f54fc1641ad42bcc6362b13836fc30feec.tar.gz
rails-457312f54fc1641ad42bcc6362b13836fc30feec.tar.bz2
rails-457312f54fc1641ad42bcc6362b13836fc30feec.zip
Remove redundant type check
All of Date, DateTime and Time respond to `iso8601`.
-rw-r--r--actionview/lib/action_view/helpers/date_helper.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb
index e1e3d99cd7..620e1e9f21 100644
--- a/actionview/lib/action_view/helpers/date_helper.rb
+++ b/actionview/lib/action_view/helpers/date_helper.rb
@@ -681,9 +681,8 @@ module ActionView
options = args.extract_options!
format = options.delete(:format) || :long
content = args.first || I18n.l(date_or_time, format: format)
- datetime = date_or_time.acts_like?(:time) ? date_or_time.xmlschema : date_or_time.iso8601
- content_tag("time".freeze, content, options.reverse_merge(datetime: datetime), &block)
+ content_tag("time".freeze, content, options.reverse_merge(datetime: date_or_time.iso8601), &block)
end
private