Description
Expected Behavior
When making requests with an invalid filter, I would expect to have an error raised.
This can be set on Ransack with the following configuration:
Ransack.configure do |config|
# Raise errors if a query contains an unknown predicate or attribute.
# Default is true (do not raise error on unknown conditions).
config.ignore_unknown_conditions = false
end
Although this does not seem to work.
Actual Behavior
When making a request with an invalid filter, the filter is not applied at all,
payments?filter[id_eqblabla]=1,2,3,4,5
will return all payments. This is far from ideal.
This happens regardless of the configuration above. JSONAPI::Filtering
configures the opposite value (not sure what value has precedence over the other):
jsonapi.rb/lib/jsonapi/patches.rb
Lines 3 to 6 in a28f6d4
I have tried to change that line and see what happens as well without success.
Not sure if this is an issue with the way JSONAPI integrates with Ransack, or something not working as expected on Ransack.
Steps
- Already described above.
Specifications
- Version: latest
- Ruby version: 2.6.6