lib/avo/current.rb in avo-3.0.1.beta22 vs lib/avo/current.rb in avo-3.0.1.beta23
- old
+ new
@@ -24,11 +24,16 @@
attribute :resource_manager
attribute :tool_manager
attribute :plugin_manager
attribute :locale
- delegate :params, to: :request
+ # Protect from error #<RuntimeError: Missing rack.input> when request is ActionDispatch::Request.empty
+ def params
+ request.params
+ rescue
+ {}
+ end
def request
- view_context.request || ActionDispatch::Request.empty
+ view_context&.request || ActionDispatch::Request.empty
end
end