aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/deprecation.rb
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2009-10-16 12:49:39 -0700
committerCarl Lerche <carllerche@mac.com>2009-10-16 12:51:02 -0700
commit2110a524a4913815d036786aa01319fd67db0ee2 (patch)
treef87858a81ac61642827c0617cad9eeceb44e8707 /railties/lib/rails/deprecation.rb
parent6094e6516951444f8c3d6bb31f171af9fe96a02f (diff)
downloadrails-2110a524a4913815d036786aa01319fd67db0ee2.tar.gz
rails-2110a524a4913815d036786aa01319fd67db0ee2.tar.bz2
rails-2110a524a4913815d036786aa01319fd67db0ee2.zip
Deprecate RAILS_ROOT in favor of Rails.root (which proxies to the application's object root)
Diffstat (limited to 'railties/lib/rails/deprecation.rb')
-rw-r--r--railties/lib/rails/deprecation.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/railties/lib/rails/deprecation.rb b/railties/lib/rails/deprecation.rb
new file mode 100644
index 0000000000..42bba151d6
--- /dev/null
+++ b/railties/lib/rails/deprecation.rb
@@ -0,0 +1,17 @@
+require "active_support/string_inquirer"
+require "active_support/deprecation"
+
+RAILS_ROOT = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do
+ def target
+ Rails.root
+ end
+
+ def replace(val)
+ puts OMG
+ end
+
+ def warn(callstack, called, args)
+ msg = "RAILS_ROOT is deprecated! Use Rails.root instead."
+ ActiveSupport::Deprecation.warn(msg, callstack)
+ end
+end).new \ No newline at end of file