I typically define my global constants in environment.rb at the
bottom. However, I've got a situation where I've got a
config.active_record.observers
call earlier on in the Rails::Initializer.run loop (of environment.rb)
That observer config call pokes one of my models. That model
uses some of my constants in validate_* calls. The problem is,
at the time that model code gets poked, the constants are not
yet defined.
Is there some other "standard" place to define constants? I have
tried just stuffing the definitions inside the Initializer.run
loop (and before the observer config), and that does avoid the
error. But is there a better place than that? I like sticking
with the conventions and standards when at all possible.
Maybe I'll just define all my local constants at the top of the file instead
and be done with it. Any reason that I'm missing that makes that
a bad idea?
Thanks.
-glenn
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby