I saw a callback in a controller that looks something like this:
before_action :do_stuff, if: [:condition_1?, :condition_2?], only: :show
What will be the behaviour of the if condition in this case? The Rails documentation only specifies passing a symbol or a Proc.
If both conditions return true
or values other than false
and nil
then do_stuff
method will be invoked but only for show
action