State machine extracted from ActiveModel