Mistři v programování na #hovnokod

Ruby #290

class User < ActiveRecord::Base

  # email is confirmed
  state_machine :email_state, :initial => :unconfirmed, :namespace => 'email' do
    event :confirm do
      transition [:unconfirmed] => :confirmed
    end

    event :unconfirm do
      transition [:confirmed] => :unconfirmed
    end
  end

end

HovnoKod,