aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/date/conversions.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-01 06:36:43 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-01 06:36:43 -0800
commit3e1e36b5addc9b89ebcc6562d697dccb98e76a59 (patch)
treeea1bfe0f2898f36af86737516be711a06f8d7af7 /activesupport/lib/active_support/core_ext/date/conversions.rb
parent224d3a69accb29f25bb46d132b8f591f25026559 (diff)
parentafc98eadb892b735a9e40fbd2a9166f15822c569 (diff)
downloadrails-3e1e36b5addc9b89ebcc6562d697dccb98e76a59.tar.gz
rails-3e1e36b5addc9b89ebcc6562d697dccb98e76a59.tar.bz2
rails-3e1e36b5addc9b89ebcc6562d697dccb98e76a59.zip
Merge pull request #13561 from robin850/issue-11723
Avoid raising a NameError on FreeBSD using Date
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date/conversions.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/date/conversions.rb7
1 files changed, 5 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 09504a4d9c..df419a6e63 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 = {
@@ -19,8 +20,10 @@ class Date
# Ruby 1.9 has Date#to_time which converts to localtime only.
remove_method :to_time
- # Ruby 1.9 has Date#xmlschema which converts to a string without the time component.
- remove_method :xmlschema
+ # Ruby 1.9 has Date#xmlschema which converts to a string without the time
+ # component. This removal may generate an issue on FreeBSD, that's why we
+ # need to use remove_possible_method here
+ remove_possible_method :xmlschema
# Convert to a formatted string. See DATE_FORMATS for predefined formats.
#