Rails 3 Deprecations

Steve Downie
Fri, 09 Apr 2010 13:50:27 -0000

I''m working my way through the transition from Rails 2 to Rails 3 and
I came across the DEPRECATION warnings that we all will start seeing
real soon. These are currently implemented as shortcuts to constants,
but to bring your code up to date and eliminate deprecation concerns,
they should all be converted.

The following are some of the most common (current way => new way):

RAILS_ROOT => Rails.root
RAILS_ENV => Rails.env
RAILS_DEFAULT_LOGGER => Rails.logger
RAILS_CACHE  => Rails.cache

But what about the following?

RAILS_CACHE_ID
RAILS_ASSET_ID
RAILS_GEMS
RAILS_FRAMEWO?RK_ROOT
RAILS DEFAULT_DATABASE
RAILS_LOADED
RAILS_PKG_DESTINATION
RAILS_RELATIVE_URL_ROOT
RAILS_CONNECTION_ADAPTERS
RAILS_GEM_VERSION
RAILS_NOISE

Others that are not so directly related include:

RAILTIES_PATH
MERB_ENV
ROUTE_FILE
DEFAULT_BEHAVIORS

These constants were taken from Jamis Buck''s "bucketwise" app
that
Jeremy McAnally uses as an example app in his well written Rails 3
Upgrade Handbook.

Is the idea that all of these constants will eventually be
transitioned from shortcuts to the Rails 3 way (attributes?) or is
there some special case for the current crop that make them special?

TIA for all replies.

-- Steve
s dot d at comc@st d0t net

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at