Hi,

I am curious if anyone would know how to reload a meta-model into what 
seems to be the global constants in Rails. Basically, this is a factory 
that creates models on the fly that contain AASM workflows, validations and 
other goodies. I can get this to work correctly if I restart the server but 
I want to be able 'reset' the constant that references the meta model if 
the code needs a refresh.  Does anyone know a way to do this? This code 
below works for the current process but I need this to refresh much like 
what happens when one adds a new file and ActiveSupport::Dependencies pick 
it up and reloads it.


At present,

    def reset_udt_const
      cn = udt_class_name
      if Object.const_defined?(cn)
       Object.instance_eval{remove_const(:"#{cn}")}
      end
      to_udt_model.reset_column_information

      MetaMark::DynamicRouter.reload
    end

Any help would be very appreciated. 

Thanks in advance.
Mark

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to