Created
December 10, 2008 05:03
-
-
Save agibralter/34240 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 User < ActiveRecord::Base | |
# ... | |
attr_accessor :password, :password_confirmation | |
attr_accessible :login, :email, :password, :password_confirmation | |
state_machine :state_email, :initial => 'fresh' do | |
before_transition :to => 'unverified', :do => :make_email_verification_code | |
before_transition :to => 'verified', :do => :set_email_verified_attributes | |
event :unverify do | |
transition :to => 'unverified', :from => %w(unverified verified fresh) | |
end | |
event :verify do | |
transition :to => 'verified', :from => %w(unverified verified fresh) | |
end | |
end | |
# ... | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment