Created
March 31, 2009 17:53
-
-
Save pezra/88302 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def expired? | |
# is the record's file_date over the specified number of days until expiration | |
if !self.identity_address.nil? && !self.identity_address.last_date_reported.blank? | |
last_date_reported = self.identity_address.last_date_reported.to_s | |
formatted_date = [ last_date_reported.slice(0,4), last_date_reported.slice(4,2), last_date_reported.slice(6,2) ].join("-") | |
begin | |
return true unless verified_date = Date.parse(formatted_date) | |
rescue Exception => e | |
raise "\"#{last_date_reported}\" is not a valid date" | |
end | |
( Date.today - verified_date ).to_i > DAYS_TO_ID_EXPIRATION | |
else | |
return true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment