aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-11-19 11:52:44 -0800
committerSantiago Pastorino <santiago@wyeworks.com>2011-11-19 11:52:44 -0800
commit4cdd44e3e0e22742a6e0ddc67c388cee0c8c13db (patch)
tree2b4b231cf6951b3e189aba447eb306e4eb24d42a /activesupport
parent43158e58b2c63d37aca611730f8635557d64fe45 (diff)
parent8d83e339fc91bfba51bb30384efc1bca6a099a53 (diff)
downloadrails-4cdd44e3e0e22742a6e0ddc67c388cee0c8c13db.tar.gz
rails-4cdd44e3e0e22742a6e0ddc67c388cee0c8c13db.tar.bz2
rails-4cdd44e3e0e22742a6e0ddc67c388cee0c8c13db.zip
Merge pull request #3668 from gregolsen/api_docstring_fix
updating API docstring so that user can infer default value
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/date/calculations.rb4
-rw-r--r--activesupport/lib/active_support/core_ext/time/calculations.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb
index 26a99658cc..c6d5f29690 100644
--- a/activesupport/lib/active_support/core_ext/date/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/date/calculations.rb
@@ -192,13 +192,13 @@ class Date
alias :sunday :end_of_week
alias :at_end_of_week :end_of_week
- # Returns a new Date/DateTime representing the start of the given day in the previous week (default is Monday).
+ # Returns a new Date/DateTime representing the start of the given day in the previous week (default is :monday).
def prev_week(day = :monday)
result = (self - 7).beginning_of_week + DAYS_INTO_WEEK[day]
self.acts_like?(:time) ? result.change(:hour => 0) : result
end
- # Returns a new Date/DateTime representing the start of the given day in next week (default is Monday).
+ # Returns a new Date/DateTime representing the start of the given day in next week (default is :monday).
def next_week(day = :monday)
result = (self + 7).beginning_of_week + DAYS_INTO_WEEK[day]
self.acts_like?(:time) ? result.change(:hour => 0) : result
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb
index 372dd69212..43cd103481 100644
--- a/activesupport/lib/active_support/core_ext/time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -176,12 +176,12 @@ class Time
end
alias :at_end_of_week :end_of_week
- # Returns a new Time representing the start of the given day in the previous week (default is Monday).
+ # Returns a new Time representing the start of the given day in the previous week (default is :monday).
def prev_week(day = :monday)
ago(1.week).beginning_of_week.since(DAYS_INTO_WEEK[day].day).change(:hour => 0)
end
- # Returns a new Time representing the start of the given day in next week (default is Monday).
+ # Returns a new Time representing the start of the given day in next week (default is :monday).
def next_week(day = :monday)
since(1.week).beginning_of_week.since(DAYS_INTO_WEEK[day].day).change(:hour => 0)
end