aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-08 07:42:02 -0700
committerJosé Valim <jose.valim@gmail.com>2011-05-08 07:42:02 -0700
commit9727dd1e385aaa188a198d86102a840ebcc625e8 (patch)
treee081ca11cc89f6f5ae7572c428a5df02b08a47ab /activesupport/lib/active_support/core_ext
parent80bf68aa1ba7aea9aded5094e81af05b159ceaa4 (diff)
parentb94d94a1ae8b80b21b0cb21f99af14dc420405e8 (diff)
downloadrails-9727dd1e385aaa188a198d86102a840ebcc625e8.tar.gz
rails-9727dd1e385aaa188a198d86102a840ebcc625e8.tar.bz2
rails-9727dd1e385aaa188a198d86102a840ebcc625e8.zip
Merge pull request #388 from smartinez87/remove_method
Better use #remove_possible_method here
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/date/conversions.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/date/conversions.rb b/activesupport/lib/active_support/core_ext/date/conversions.rb
index 769ead9544..338104fd05 100644
--- a/activesupport/lib/active_support/core_ext/date/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/date/conversions.rb
@@ -1,6 +1,7 @@
require 'date'
require 'active_support/inflector/methods'
require 'active_support/core_ext/date/zones'
+require 'active_support/core_ext/module/remove_method'
class Date
DATE_FORMATS = {
@@ -13,10 +14,10 @@ class Date
}
# Ruby 1.9 has Date#to_time which converts to localtime only.
- remove_method :to_time if method_defined?(:to_time)
+ remove_possible_method :to_time
# Ruby 1.9 has Date#xmlschema which converts to a string without the time component.
- remove_method :xmlschema if method_defined?(:xmlschema)
+ remove_possible_method :xmlschema
# Convert to a formatted string. See DATE_FORMATS for predefined formats.
#