Skip to content

Instantly share code, notes, and snippets.

View manishdas's full-sized avatar

Manish Das manishdas

View GitHub Profile
@the-architect
the-architect / contact.rb
Created September 15, 2011 16:09
Automatically create scopes for all available state_machine states in Rails 3.1
class Contact < ActiveRecord::Base
state_machine :state, :initial => :imported do
state :imported
state :contacted
state :verified
state :prospect
state :deleted
end