mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-04 20:10:16 +01:00
move as_text helpers to respective pattern
This commit is contained in:
parent
cbdbb792a5
commit
d8507bf8b7
6 changed files with 77 additions and 85 deletions
|
|
@ -14,6 +14,16 @@ module RecurringTodos
|
|||
get :only_work_days
|
||||
end
|
||||
|
||||
def recurrence_pattern
|
||||
if only_work_days?
|
||||
I18n.t("todos.recurrence.pattern.on_work_days")
|
||||
elsif every_x_days > 1
|
||||
I18n.t("todos.recurrence.pattern.every_n", :n => every_x_days) + " " + I18n.t("common.days_midsentence.other")
|
||||
else
|
||||
I18n.t("todos.recurrence.pattern.every_day")
|
||||
end
|
||||
end
|
||||
|
||||
def validate
|
||||
super
|
||||
errors[:base] << "Every other nth day may not be empty for this daily recurrence setting" if (!only_work_days?) && every_x_days.blank?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue