Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #13561 from robin850/issue-11723

Avoid raising a NameError on FreeBSD using Date
Conflicts:
	activesupport/CHANGELOG.md
  • Loading branch information...
commit c263a9a03585d5163c352847dea1bb3f287c7c48 1 parent 2ff4933
@rafaelfranca rafaelfranca authored
View
5 activesupport/CHANGELOG.md
@@ -1,3 +1,8 @@
+* Use `remove_possible_method` instead of `remove_method` to avoid
+ a `NameError` to be thrown on FreeBSD with the `Date` object.
+
+ *Rafael Mendonça França*, *Robin Dupret*
+
* Default the new `I18n.enforce_available_locales` config to `true`, meaning
`I18n` will make sure that all locales passed to it must be declared in the
`available_locales` list.
View
6 activesupport/lib/active_support/core_ext/date/conversions.rb
@@ -19,8 +19,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.
#
Please sign in to comment.
Something went wrong with that request. Please try again.