Module: Rails::ForwardCompatibleControllerTests
- Defined in:
- lib/rails/forward_compatible_controller_tests.rb,
lib/rails/forward_compatible_controller_tests/version.rb
Constant Summary collapse
- ERROR_MESSAGE =
'Please use Rails 5 syntax. See: https://github.com/appfolio/rails-forward_compatible_controller_tests'- VERSION =
"2.3.0"
Class Attribute Summary collapse
-
.old_syntax_strategy ⇒ Object
readonly
Returns the value of attribute old_syntax_strategy.
Class Method Summary collapse
- .deprecate ⇒ Object
- .deprecated? ⇒ Boolean
- .ignore ⇒ Object
- .raise_exception ⇒ Object
- .raise_exception? ⇒ Boolean
Instance Method Summary collapse
Class Attribute Details
.old_syntax_strategy ⇒ Object (readonly)
Returns the value of attribute old_syntax_strategy.
11 12 13 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 11 def old_syntax_strategy @old_syntax_strategy end |
Class Method Details
.deprecate ⇒ Object
13 14 15 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 13 def deprecate @old_syntax_strategy = :deprecation_warning end |
.deprecated? ⇒ Boolean
17 18 19 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 17 def deprecated? @old_syntax_strategy == :deprecation_warning end |
.ignore ⇒ Object
21 22 23 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 21 def ignore @old_syntax_strategy = nil end |
.raise_exception ⇒ Object
25 26 27 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 25 def raise_exception @old_syntax_strategy = :raise_exception end |
.raise_exception? ⇒ Boolean
29 30 31 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 29 def raise_exception? @old_syntax_strategy == :raise_exception end |
Instance Method Details
#xhr(request_method, action, parameters = nil, *args) ⇒ Object
115 116 117 118 119 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 115 def xhr(request_method, action, parameters = nil, *args) raise Exception, ERROR_MESSAGE if ForwardCompatibleControllerTests.raise_exception? ActiveSupport::Deprecation.warn(ERROR_MESSAGE) if ForwardCompatibleControllerTests.deprecated? super(request_method, action, parameters, *args) end |