I am using Ruby on Rails 3.0.9 and I am developing a plugin. I would like to know if it "right" to state a constant value like this (note the ||
):
CONSTANT_NAME ||= "Constant_value"
Is it a proper\ensured approach the above?
P.S.: I would like to make that in order to avoid to log warning messages like the following in the Apache error_log
file:
/<RAILS_ROOT>/vendor/plugins/sample_plugin/lib/sample.rb:52: warning: already initialized constant CONSTANT_NAME