Skip to content

Commit 4cdd44e

Browse files
committed
Merge pull request rails#3668 from gregolsen/api_docstring_fix
updating API docstring so that user can infer default value
2 parents 43158e5 + 8d83e33 commit 4cdd44e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

activesupport/lib/active_support/core_ext/date/calculations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ def end_of_week
192192
alias :sunday :end_of_week
193193
alias :at_end_of_week :end_of_week
194194

195-
# Returns a new Date/DateTime representing the start of the given day in the previous week (default is Monday).
195+
# Returns a new Date/DateTime representing the start of the given day in the previous week (default is :monday).
196196
def prev_week(day = :monday)
197197
result = (self - 7).beginning_of_week + DAYS_INTO_WEEK[day]
198198
self.acts_like?(:time) ? result.change(:hour => 0) : result
199199
end
200200

201-
# Returns a new Date/DateTime representing the start of the given day in next week (default is Monday).
201+
# Returns a new Date/DateTime representing the start of the given day in next week (default is :monday).
202202
def next_week(day = :monday)
203203
result = (self + 7).beginning_of_week + DAYS_INTO_WEEK[day]
204204
self.acts_like?(:time) ? result.change(:hour => 0) : result

activesupport/lib/active_support/core_ext/time/calculations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ def end_of_week
176176
end
177177
alias :at_end_of_week :end_of_week
178178

179-
# Returns a new Time representing the start of the given day in the previous week (default is Monday).
179+
# Returns a new Time representing the start of the given day in the previous week (default is :monday).
180180
def prev_week(day = :monday)
181181
ago(1.week).beginning_of_week.since(DAYS_INTO_WEEK[day].day).change(:hour => 0)
182182
end
183183

184-
# Returns a new Time representing the start of the given day in next week (default is Monday).
184+
# Returns a new Time representing the start of the given day in next week (default is :monday).
185185
def next_week(day = :monday)
186186
since(1.week).beginning_of_week.since(DAYS_INTO_WEEK[day].day).change(:hour => 0)
187187
end

0 commit comments

Comments
 (0)