Matt Jones wrote in post #1080951: > On Friday, 25 June 2010 01:12:47 UTC-4, [email protected] wrote: >> I have a ton of models that each have fairly complex state machines. >> >> My state_machine blocks however are very large and clutter up my >> model.rb files... >> >> What I want to do is extract out all of the state machine code to >> another file that I can then "include" in my model. I know include is >> the wrong terminology in ruby.. maybe I want to modularize them? >> > > One mechanism that can be helpful that hasn't been mentioned - > ActiveSupport::Concern. See here for more detail: >
Funny, as soon as I came back to check the update I said to myself "knowing what I know now, I would have probably used a concern". I second your suggestion. > http://www.fakingfantastic.com/2010/09/20/concerning-yourself-with-active-support-concern/ > > --Matt Jones -- 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.

