I used to rescue an Exception like this:
unless
Rails.application.config.consider_all_requests_local> rescue_from Exception, :with => :render_error
> end
But this is hard to test.
So I removed the condition in the controller and added it in the
render_error method itself: raise e if request.local?
And in my test I overwrite ActionDispatch::Request
class ::ActionDispatch::Request> def local? ; false end
> end
What do you think?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/R5vuMlwn86AJ.
For more options, visit https://groups.google.com/groups/opt_out.