diff options
-rw-r--r-- | activesupport/CHANGELOG.md | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/date/zones.rb | 15 | ||||
-rw-r--r-- | activesupport/test/core_ext/date_ext_test.rb | 7 |
3 files changed, 4 insertions, 22 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index d4679eac6c..1853c6048b 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove deprecated `Date#to_time_in_current_zone` in favour of `Date#in_time_zone`. + + *Vipul A M* + * Remove deprecated `Proc#bind` with no replacement. *Carlos Antonio da Silva* diff --git a/activesupport/lib/active_support/core_ext/date/zones.rb b/activesupport/lib/active_support/core_ext/date/zones.rb index b4548671bf..538ed00406 100644 --- a/activesupport/lib/active_support/core_ext/date/zones.rb +++ b/activesupport/lib/active_support/core_ext/date/zones.rb @@ -2,21 +2,6 @@ require 'date' require 'active_support/core_ext/time/zones' class Date - # *DEPRECATED*: Use +Date#in_time_zone+ instead. - # - # Converts Date to a TimeWithZone in the current zone if <tt>Time.zone</tt> or - # <tt>Time.zone_default</tt> is set, otherwise converts Date to a Time via - # Date#to_time. - def to_time_in_current_zone - ActiveSupport::Deprecation.warn 'Date#to_time_in_current_zone is deprecated. Use Date#in_time_zone instead', caller - - if ::Time.zone - ::Time.zone.local(year, month, day) - else - to_time - end - end - # Converts Date to a TimeWithZone in the current zone if Time.zone or Time.zone_default # is set, otherwise converts Date to a Time via Date#to_time # diff --git a/activesupport/test/core_ext/date_ext_test.rb b/activesupport/test/core_ext/date_ext_test.rb index aa5e4461fd..c32056f672 100644 --- a/activesupport/test/core_ext/date_ext_test.rb +++ b/activesupport/test/core_ext/date_ext_test.rb @@ -363,10 +363,3 @@ class DateExtBehaviorTest < ActiveSupport::TestCase end end -class DateExtConversionsTest < ActiveSupport::TestCase - def test_to_time_in_current_zone_is_deprecated - assert_deprecated(/to_time_in_current_zone/) do - Date.new(2012,6,7).to_time_in_current_zone - end - end -end |