Skip to content

Instantly share code, notes, and snippets.

@svs
Created August 28, 2012 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svs/3496414 to your computer and use it in GitHub Desktop.
Save svs/3496414 to your computer and use it in GitHub Desktop.
B.S. i.e. Before StateMachine
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