Created
August 28, 2012 09:10
-
-
Save svs/3496414 to your computer and use it in GitHub Desktop.
B.S. i.e. Before StateMachine
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
class Document | |
property :name, Text | |
.... # all the other properties | |
.... | |
property :scanned_on, Date | |
property :tagged_on, Date | |
property :approved_on, Date | |
... | |
... | |
... | |
belongs_to :scanned_by, User | |
belongs_to :approved_by, User | |
... | |
... | |
def state | |
return "applied" if applied_by and !approved_on and !disbursed_on | |
... # rest of code to check the state of the document. | |
... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment