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.
4349a46c5faf5658a7240c22b3c4c21f?d=identicon&s=25 Bob Mundane (pgs)
on 2008-11-28 16: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
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-11-28 16:48
(Received via mailing list)
On Nov 28, 3:43 pm, Bob Mundane <rails-mailing-l...@andreas-s.net>
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
4349a46c5faf5658a7240c22b3c4c21f?d=identicon&s=25 Bob Mundane (pgs)
on 2008-11-28 17:30
Thanks a lot Fred ! I was totally unaware about this...
This topic is locked and can not be replied to.