From 245e7b46180321cc9763dbf931266ff9cc1699b1 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Mon, 24 Sep 2012 16:19:23 +1000 Subject: Rename method --- app/models/info_request.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 2e16d0f58..b34f51df2 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -688,7 +688,7 @@ public # things, e.g. fees, not properly covered. def date_response_required_by days_later = MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20) - return Holiday.due_date_from(self.date_initial_request_last_sent_at, days_later) + return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, days_later) end # This is a long stop - even with UK public interest test extensions, 40 # days is a very long time. @@ -698,10 +698,10 @@ public school_very_late_days_later = MySociety::Config.get('SPECIAL_REPLY_VERY_LATE_AFTER_DAYS', 60) if self.public_body.is_school? # schools have 60 working days maximum (even over a long holiday) - return Holiday.due_date_from(self.date_initial_request_last_sent_at, 60) + return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, 60) else # public interest test ICO guidance gives 40 working maximum - return Holiday.due_date_from(self.date_initial_request_last_sent_at, 40) + return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, 40) end end -- cgit v1.2.3 From 9d28b41b96cf3ecead26c72bd64ff069f8bd519f Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Mon, 24 Sep 2012 18:26:20 +1000 Subject: Fix: configuration for very late number of days wasn't being used --- app/models/info_request.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index b34f51df2..05f9195b3 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -698,10 +698,10 @@ public school_very_late_days_later = MySociety::Config.get('SPECIAL_REPLY_VERY_LATE_AFTER_DAYS', 60) if self.public_body.is_school? # schools have 60 working days maximum (even over a long holiday) - return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, 60) + return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, school_very_late_days_later) else # public interest test ICO guidance gives 40 working maximum - return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, 40) + return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, very_late_days_later) end end -- cgit v1.2.3 From 4cd4eacd7f43536f2b0f4bc9b8eb0fc2445031c5 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Mon, 24 Sep 2012 18:49:14 +1000 Subject: Make the way number of days are calculated (either by calendar or working days) configurable --- app/models/info_request.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 05f9195b3..aa4f7537a 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -688,7 +688,8 @@ public # things, e.g. fees, not properly covered. def date_response_required_by days_later = MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20) - return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, days_later) + working_or_calendar_days = MySociety::Config.get('WORKING_OR_CALENDAR_DAYS', 'working') + return Holiday.due_date_from(self.date_initial_request_last_sent_at, days_later, working_or_calendar_days) end # This is a long stop - even with UK public interest test extensions, 40 # days is a very long time. @@ -696,12 +697,13 @@ public last_sent = last_event_forming_initial_request very_late_days_later = MySociety::Config.get('REPLY_VERY_LATE_AFTER_DAYS', 40) school_very_late_days_later = MySociety::Config.get('SPECIAL_REPLY_VERY_LATE_AFTER_DAYS', 60) + working_or_calendar_days = MySociety::Config.get('WORKING_OR_CALENDAR_DAYS', 'working') if self.public_body.is_school? # schools have 60 working days maximum (even over a long holiday) - return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, school_very_late_days_later) + return Holiday.due_date_from(self.date_initial_request_last_sent_at, school_very_late_days_later, working_or_calendar_days) else # public interest test ICO guidance gives 40 working maximum - return Holiday.due_date_from_working_days(self.date_initial_request_last_sent_at, very_late_days_later) + return Holiday.due_date_from(self.date_initial_request_last_sent_at, very_late_days_later, working_or_calendar_days) end end -- cgit v1.2.3