0

For a model class with AASM state machine, there is following def in the model class:

class Job
  include AASM

  aasm do
    state :sleeping, :initial => true, :before_enter => :do_something
    state :running
    state :finished
   ......
end

My question is that, does the aasm gem load the def above everytime when it is in need. Or just load the def once when the model class is initially loaded and use it repeatedly through out the rest of the session.

user938363
  • 9,990
  • 38
  • 137
  • 303

1 Answers1

0

I think it depends on your environment settings. Usually in development the classes are reloaded if something changed - in production mode these classes will be cached and only loaded once at startup.

BvuRVKyUVlViVIc7
  • 11,641
  • 9
  • 59
  • 111