Matt Jones wrote in post #1080951:
> On Friday, 25 June 2010 01:12:47 UTC-4, frankj...@gmail.com 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment