diff --git a/lib/surveyor/models/response_methods.rb b/lib/surveyor/models/response_methods.rb index b9b7fe96..80784775 100644 --- a/lib/surveyor/models/response_methods.rb +++ b/lib/surveyor/models/response_methods.rb @@ -51,7 +51,7 @@ def correct? end def time_value - datetime_value.try(:strftime, time_format) + read_attribute(:datetime_value).strftime( time_format ) unless read_attribute(:datetime_value).blank? end def time_value=(val) @@ -64,7 +64,7 @@ def time_value=(val) end def date_value - datetime_value.try(:strftime, date_format) + read_attribute(:datetime_value).strftime( date_format ) unless read_attribute(:datetime_value).blank? end def date_value=(val) @@ -76,10 +76,6 @@ def date_value=(val) end end - def datetime_value - read_attribute(:datetime_value) - end - def time_format '%H:%M' end @@ -102,7 +98,7 @@ def to_formatted_s when :time time_value when :datetime - datetime_value.try(:strftime, datetime_format) || '' + (read_attribute(:datetime_value).strftime( datetime_format ) unless read_attribute(:datetime_value).blank?) || '' else to_s end