Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove duplication from date_time calculations

Methods: :past? and :future? are already defined identically
in date_and_time/calculations.rb which is included in Date.
Because DateTime is a subclass of Date, it can call them.
  • Loading branch information...
commit 89060b8ef9b56e69e5f28754b5b633f6c8b8c909 1 parent ffb680e
@gzohari gzohari authored
View
10 activesupport/lib/active_support/core_ext/date_time/calculations.rb
@@ -10,16 +10,6 @@ def current
end
end
- # Tells whether the DateTime object's datetime lies in the past.
- def past?
- self < ::DateTime.current
- end
-
- # Tells whether the DateTime object's datetime lies in the future.
- def future?
- self > ::DateTime.current
- end
-
# Seconds since midnight: DateTime.now.seconds_since_midnight.
def seconds_since_midnight
sec + (min * 60) + (hour * 3600)
Please sign in to comment.
Something went wrong with that request. Please try again.