I think it’s crazy when I implement something that “Surely, I’m the only one that’ll ever use this”, and then another implementation ends up in Rails proper. Last year, I wrote acts_as_fsm; a state machine implementation for ActiveRecord models:
SaleMachine = Fsm::state_machine do state :new => :queued state :queued => :new state :queued => :on_site do |sale, old, new| sale.started_at = Time.now end state :on_site => :processing_orders do |sale, old, new| sale.ended_at = Time.now sale.orders.each do |o| o.status_items << OrderStatusItem.new(:status => "CLOSE_WAIT", :message => "Sale ended. Waiting for a few stragglers" ); o.save! end end state :processing_orders => :shipped endAnd then, to use the machine:
class Sale < ActiveRecord::Base acts_as_fsm :machine => SaleMachine endThere is nothing I love more than throwing away code I wrote and migrating to something in the framework. Less stuff for me to maintain. Check out ActiveRecord::StateMachine.
Trying to reason about code with pen-and-paper is a distressing experience. Like trying to explain guitar scales without a guitar nearby.
I’ll be blunt and say Trac is only open source issue tracker both designed for humans, and with enough features to make it realistically usable, and it seems to be pretty popular. I’ve used it for years.
Obviously, git seems to be the defacto DVCS these days.
Why on earth do must I install a self-described “proof of concept” plugin to make the two work together?
As an aside, the plugin does seem to work wonderfully.