mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-17 20:58:09 +01:00
move model validation into pattern classes and link from recurring_todo model
This commit is contained in:
parent
776a046465
commit
29b815e998
7 changed files with 201 additions and 77 deletions
|
|
@ -7,9 +7,19 @@ module RecurringTodos
|
|||
end
|
||||
|
||||
def every_x_days
|
||||
@recurring_todo.every_other1
|
||||
get :every_other1
|
||||
end
|
||||
|
||||
def only_work_days?
|
||||
get :only_work_days
|
||||
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?
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue