Gentlemen thanks for having this conversation. Was pulling my hair out 
trying to get state_machine to work with a mixin. I need to define 
state_machines behaviors unique to each client while keeping a single 
code base. I ended up using opening up the class like Maren suggested.

class OnDemandWorkorderWorkflow < Workflow

  belongs_to :workorder

  attr_accessible :type, :state, :workorder_id


  require 
"#{Rails.root}/lib/clients/#{CUSTOMER}/workflows/#{FILE_REFERENCE}_on_demand_workorder_workflow"

end


required file looks like this:

class OnDemandWorkorderWorkflow < Workflow

  state_machine :state, :initial => :new do
    .......
    # lots of events and transitions
    .......
end

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to