Shall I prefer "require_or_load" vs "require"?

10 views
Skip to first unread message

Panayotis Matsinopoulos

unread,
Aug 18, 2016, 11:23:13 AM8/18/16
to Ruby on Rails: Talk
Hi,

I see that "require_or_load" keeps a "loaded" array with the files that have been required or loaded. Shall I prefer "require_or_load" vs "required" in my Ruby on Rails code.

Note that I have come to this after trying to sort out a list of WARNINGS that I was getting when, on development environment, I turned the "config.eager_load" to "true".
The warnings were about constants already defined, which was because some of the files, originally "required", then with "config.eager_load" "true" were "loaded" second time.

Your thoughts?

P. 
Reply all
Reply to author
Forward
0 new messages