|
|
@ -106,15 +106,11 @@ class Log < ApplicationRecord |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def collection_period_open? |
|
|
|
def collection_period_open? |
|
|
|
return false if older_than_previous_collection_year? |
|
|
|
return true |
|
|
|
|
|
|
|
|
|
|
|
form.new_logs_end_date > Time.zone.today |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def collection_period_open_for_editing? |
|
|
|
def collection_period_open_for_editing? |
|
|
|
return false if older_than_previous_collection_year? |
|
|
|
return true |
|
|
|
|
|
|
|
|
|
|
|
form.edit_end_date > Time.zone.today |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def blank_invalid_non_setup_fields! |
|
|
|
def blank_invalid_non_setup_fields! |
|
|
@ -207,9 +203,7 @@ private |
|
|
|
|
|
|
|
|
|
|
|
# Handle logs that are older than previous collection start date |
|
|
|
# Handle logs that are older than previous collection start date |
|
|
|
def older_than_previous_collection_year? |
|
|
|
def older_than_previous_collection_year? |
|
|
|
return false unless startdate |
|
|
|
return false |
|
|
|
|
|
|
|
|
|
|
|
startdate < previous_collection_start_date |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def plural_gender_for_person(person_num) |
|
|
|
def plural_gender_for_person(person_num) |
|
|
|