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. On Sunday, June 1, 2014 3:27:57 PM UTC-4, j...@garvinz.com wrote: > > 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? > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.