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.4.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.
10 11 12 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 10 def old_syntax_strategy @old_syntax_strategy end |
Class Method Details
.deprecate ⇒ Object
12 13 14 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 12 def deprecate @old_syntax_strategy = :deprecation_warning end |
.deprecated? ⇒ Boolean
16 17 18 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 16 def deprecated? @old_syntax_strategy == :deprecation_warning end |
.ignore ⇒ Object
20 21 22 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 20 def ignore @old_syntax_strategy = nil end |
.raise_exception ⇒ Object
24 25 26 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 24 def raise_exception @old_syntax_strategy = :raise_exception end |
.raise_exception? ⇒ Boolean
28 29 30 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 28 def raise_exception? @old_syntax_strategy == :raise_exception end |
Instance Method Details
#xhr(request_method, action, parameters = nil, *args) ⇒ Object
117 118 119 120 121 |
# File 'lib/rails/forward_compatible_controller_tests.rb', line 117 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 |