Permalink
Browse files

Add a deprecation warning about config.action_view.debug_rjs.

Upgrading to 3.1 removes debug_rjs and upgraded apps will fail to start up.
  • Loading branch information...
1 parent 2004fb9 commit b03da2417b6d105b7e33367ab65f0fcd02cb3d13 @NZKoz NZKoz committed May 17, 2011
Showing with 11 additions and 3 deletions.
  1. +5 −1 actionpack/lib/action_view/base.rb
  2. +6 −2 actionpack/test/template/prototype_helper_test.rb
@@ -165,8 +165,12 @@ module Subclasses
# Specify whether RJS responses should be wrapped in a try/catch block
# that alert()s the caught exception (and then re-raises it).
- cattr_accessor :debug_rjs
+ cattr_reader :debug_rjs
@@debug_rjs = false
+ def self.debug_rjs=(new_value)
+ ActiveSupport::Deprecation.warn("config.action_view.debug_rjs will be removed in 3.1, from 3.1 onwards you will need to install prototype-rails to continue to use RJS templates ")
+ @@debug_rjs = new_value
+ end
# Specify the proc used to decorate input tags that refer to attributes with errors.
cattr_accessor :field_error_proc
@@ -435,11 +435,15 @@ def test_collection_proxy_with_each_slice
end
def test_debug_rjs
- ActionView::Base.debug_rjs = true
+ assert_deprecated /prototype-rails/ do
+ ActionView::Base.debug_rjs = true
+ end
@generator['welcome'].replace_html 'Welcome'
assert_equal "try {\n$(\"welcome\").update(\"Welcome\");\n} catch (e) { alert('RJS error:\\n\\n' + e.toString()); alert('$(\\\"welcome\\\").update(\\\"Welcome\\\");'); throw e }", @generator.to_s
ensure
- ActionView::Base.debug_rjs = false
+ assert_deprecated /prototype-rails/ do
+ ActionView::Base.debug_rjs = false
+ end
end
def test_literal

0 comments on commit b03da24

Please sign in to comment.