-
-
Save jimdalbano/5960094 to your computer and use it in GitHub Desktop.
This file contains 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
after_save :expires_at #once its been saved update the expires_at attribute | |
def expired? | |
if accepted! #if an offer has been accepted it cannot expire | |
return false | |
else | |
created_at < expires_at ? false : true #if created_at is less than expires_at return false, else return true | |
end | |
end | |
def expires_at | |
created_at + 6.months | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment