Skip to content

Commit

Permalink
revert "fixing some tests on ruby 1.9.3 SHA 33f222b"
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishnu Atrai committed Jan 6, 2012
1 parent c8fef32 commit 4f75809
Showing 1 changed file with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,6 @@ def end_of_day
change(:hour => 23, :min => 59, :sec => 59)
end

# 1.9.3 defines + and - on DateTime, < 1.9.3 do not.
if DateTime.public_instance_methods(false).include?(:+)
def plus_with_duration(other) #:nodoc:
if ActiveSupport::Duration === other
other.since(self)
else
plus_without_duration(other)
end
end
alias_method :plus_without_duration, :+
alias_method :+, :plus_with_duration

def minus_with_duration(other) #:nodoc:
if ActiveSupport::Duration === other
plus_with_duration(-other)
else
minus_without_duration(other)
end
end
alias_method :minus_without_duration, :-
alias_method :-, :minus_with_duration
end

# Adjusts DateTime to UTC by adding its offset value; offset is set to 0
#
# Example:
Expand Down

0 comments on commit 4f75809

Please sign in to comment.