mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-01 14:58:50 +01:00
fix #1305 and #1309. Only check on show_from in the past when you change the show_from. This will not prevent a save of the todo when another change is made and show_from has some old date
This commit is contained in:
parent
be26cfdd66
commit
dd83040ea0
3 changed files with 32 additions and 12 deletions
|
|
@ -108,8 +108,10 @@ class Todo < ActiveRecord::Base
|
|||
validate :check_circular_dependencies
|
||||
|
||||
def check_show_from_in_future
|
||||
if !show_from.blank? && show_from < user.date
|
||||
errors.add("show_from", I18n.t('models.todo.error_date_must_be_future'))
|
||||
if show_from_changed? # only check on change of show_from
|
||||
if !show_from.blank? && (show_from < user.date)
|
||||
errors.add("show_from", I18n.t('models.todo.error_date_must_be_future'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue