Created
January 27, 2009 15:07
-
-
Save sob/53376 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
class Lead < ActiveRecord::Base | |
include Splam | |
has_force :oid => '<insert oid>' | |
validates_presence_of :first_name, :last_name | |
state_machine :state, :initial => 'pending' do | |
event :submit do | |
transition :to => 'spam', :from => 'pending', :if => :splam? | |
transition :to => 'submitted', :from => 'pending', :if => :to_salesforce | |
transition :to => 'pending' | |
end | |
after_transition :to => 'submitted', :do => :update_submitted_at # simple timestamp field | |
end | |
after_create :submit! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment