aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2012-12-11 06:47:47 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2012-12-11 06:47:47 +0000
commit681697813be40395ef79e1aa0d295d01d99ae596 (patch)
treed3e2613e63ed35cbbbd9059353bd4fd5c04d425f /activesupport/lib/active_support/core_ext
parent331a82a1c8ec25cd8df3297b434cbb7cc020207a (diff)
downloadrails-681697813be40395ef79e1aa0d295d01d99ae596.tar.gz
rails-681697813be40395ef79e1aa0d295d01d99ae596.tar.bz2
rails-681697813be40395ef79e1aa0d295d01d99ae596.zip
Add missing at_end_of_* aliases
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/date/calculations.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/date_time/calculations.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/time/calculations.rb2
3 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb
index 439d380af7..d76eba4de7 100644
--- a/activesupport/lib/active_support/core_ext/date/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/date/calculations.rb
@@ -75,6 +75,7 @@ class Date
def end_of_day
to_time_in_current_zone.end_of_day
end
+ alias :at_end_of_day :end_of_day
def plus_with_duration(other) #:nodoc:
if ActiveSupport::Duration === other
diff --git a/activesupport/lib/active_support/core_ext/date_time/calculations.rb b/activesupport/lib/active_support/core_ext/date_time/calculations.rb
index f77d444479..fca5d4d679 100644
--- a/activesupport/lib/active_support/core_ext/date_time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/date_time/calculations.rb
@@ -110,6 +110,7 @@ class DateTime
def end_of_day
change(:hour => 23, :min => 59, :sec => 59)
end
+ alias :at_end_of_day :end_of_day
# Returns a new DateTime representing the start of the hour (hh:00:00).
def beginning_of_hour
@@ -121,6 +122,7 @@ class DateTime
def end_of_hour
change(:min => 59, :sec => 59)
end
+ alias :at_end_of_hour :end_of_hour
# Adjusts DateTime to UTC by adding its offset value; offset is set to 0.
#
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb
index 46c9f05c15..1f17378c8d 100644
--- a/activesupport/lib/active_support/core_ext/time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -160,6 +160,7 @@ class Time
:usec => Rational(999999999, 1000)
)
end
+ alias :at_end_of_day :end_of_day
# Returns a new Time representing the start of the hour (x:00)
def beginning_of_hour
@@ -175,6 +176,7 @@ class Time
:usec => Rational(999999999, 1000)
)
end
+ alias :at_end_of_hour :end_of_hour
# Returns a Range representing the whole day of the current time.
def all_day