Hi Xavier.

Right you are about the files and autoloading. All of the files that I was 
meta~programming were just ActiveRecord models, so what I did was take what 
was being instance/class_eval'd and dumped it into a model class. 

So now when I make a change to the model, say change up a workflow (which 
is really a gui version of AASM with several modifications) or add a new 
has_many field and  need these changes to take effect they will because the 
model file will be re-written at the end of that process.. Ok, so that is 
good for right now, but I need to demo this on a production server asap. So 
really my problem is convincing the production server that it needs to 
re-compile  this model. I am reading up of a good way to do this but 
unfortunately I haven't found anything that will help me...yet. Phusion 
Passenger will allow you to re-start the app but doesn't have any way to 
tell it to recompile a file based on the last time it was modified.

I have my ear to the ground if anyone has any ideas. As of right now, I am 
not sure this is possible but...there is always a way ;)

Back in a bit!

Cheers,
Mark

On Thursday, March 24, 2016 at 10:55:27 AM UTC-4, loveand light wrote:
>
> 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