1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/abstract_controller
Jess Bees 60f7d49033 Raise error when callback's only/unless symbols aren't methods
When `before_action :callback, only: :action_name` is declared on a
controller that doesn't respond to `action_name`, raise an exception
at request time. This is a safety measure to ensure that typos or
forgetfulness don't prevent a crucial callback from being run when it
should.

Include names of filters for more useful error messages

The error message of the raised exception will be more useful if it
indicates the names of the callbacks that have the missing conditinoal
action.

The way the callbacks get shoehorned into `_normalize_callback_options`
options parameter is a little awkward, but done this way to avoid
changing the method's signature, since it is a publicly documented
method.
2021-12-14 15:22:08 -05:00
..
caching Enable Style/ExplicitBlockArgument cop 2021-09-05 17:06:19 +02:00
railties Delete orphan requires in AS::Dependencies 2021-08-19 00:14:06 +02:00
asset_paths.rb Standardize nodoc comments 2021-07-29 21:18:07 +00:00
base.rb Set the execution context from AC::Metal rather than AbstractController 2021-11-15 15:36:28 +01:00
caching.rb Replace map + compact with filter_map 2021-04-22 22:08:34 -03:00
callbacks.rb Raise error when callback's only/unless symbols aren't methods 2021-12-14 15:22:08 -05:00
collector.rb Fix generated MIME methods to recognize kwargs 2021-08-07 13:59:08 +09:00
error.rb Standardize nodoc comments 2021-07-29 21:18:07 +00:00
helpers.rb Delete orphan requires in AS::Dependencies 2021-08-19 00:14:06 +02:00
logger.rb Standardize nodoc comments 2021-07-29 21:18:07 +00:00
rendering.rb Replaces the "hash rocket" operator in favor of the newer Ruby syntax when rendering on render 2021-10-03 23:33:56 -03:00
translation.rb Extract common behavior of html safe translation to a module 2021-10-12 18:03:46 +00:00
url_for.rb