Forum: Ruby on Rails Where are the environments constant defined ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bob M. (Guest)
on 2008-11-28 17:43
Hi, constants defined in environment.rb are application wide.

But how and where are they stored ? I mean which is the class or module
to which they are attached ?

Thanks
Frederick C. (Guest)
on 2008-11-28 17:48
(Received via mailing list)
On Nov 28, 3:43 pm, Bob M. <removed_email_address@domain.invalid>
wrote:
> Hi, constants defined in environment.rb are application wide.
>
> But how and where are they stored ? I mean which is the class or module
> to which they are attached ?
>
Object. (and there's nothing special about environment.rb. If you
define a constant outside of a class or module then it will get set at
the top level (bearing in mind that ruby's constant resolution only
really cares about lexical scope)

Fred
Bob M. (Guest)
on 2008-11-28 18:30
Thanks a lot Fred ! I was totally unaware about this...
This topic is locked and can not be replied to.