1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove redundant type check

All of Date, DateTime and Time respond to `iso8601`.
This commit is contained in:
Andrew White 2018-04-06 11:50:04 +01:00
parent d514ce9199
commit 457312f54f
No known key found for this signature in database
GPG key ID: 7E83729F16B086CF

View file

@ -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