Mystery conditional on alias_method in DateTime core extension

I’m working on a proposed refactoring of to_formatted_s in the Date, Time and DateTime core extenstions in ActiveSupport.

I’m wondering if anyone can explain what the conditional is for here… https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/date_time/conversions.rb#L40

I’ve traced it’s existence back to this commit from Jeremy in 2008 but the commit message is a bit Greek to me. https://github.com/rails/rails/commit/047db112991785d871e9a6ba165b93752b0fff06

There’s nearly identical code in the Date and Time extensions, but only the DateTime extension includes this mystery condition. Any insights?

It seems to me that could fit in the preoptimization area as by default. Did you try looking for places where to_default_s would be called outside of DateTime? It may help you out.

Unless I’m missing the point, I believe this method (to_default_s) could be removed from the API alltogether. It would break backward compatibility though so if it merges, I believe it wouldn’t be available until Rails 5.