rails/actionview/test/fixtures/topics.yml
Rafael Mendonça França c2e12e0191
Use to_formatted_s(:db) instead of to_s(:db) internally
Ruby 3.1 introduced an optimization to string interpolation for some
core classes in b08dacfea3.

But since we override `to_s` in some of those core classes to add behavior
like `to_s(:db)`, all Rails applications will not be able to take advantage
of that improvement.

Since we can use the `to_formatted_s` alias for the Rails specific behavior
it is best for us to deprecate the `to_s` core extension and allow Rails
applications to get the proformace improvement.

This commit starts removing all the `to_s(:db)` calls inside the framework
so we can deprecate the core extension in the next commit.
2021-12-06 19:22:04 +00:00

23 lines
568 B
YAML

futurama:
id: 1
title: Isn't futurama awesome?
subtitle: It really is, isn't it.
content: I like futurama
created_at: <%= 1.day.ago.to_formatted_s(:db) %>
updated_at:
harvey_birdman:
id: 2
title: Harvey Birdman is the king of all men
subtitle: yup
content: It really is
created_at: <%= 2.hours.ago.to_formatted_s(:db) %>
updated_at:
rails:
id: 3
title: Rails is nice
subtitle: It makes me happy
content: except when I have to hack internals to fix pagination. even then really.
created_at: <%= 20.minutes.ago.to_formatted_s(:db) %>