Open sienic opened 3 years ago
Unfortunately, this does not work with the sort parameter (which uses the same function I modified). I will wait for further feedback on how you'd like to go about this, as there are multiple possibilities, and this issue actually might not be an issue from your point of view.
Thank you for this, @sienic. FWIW I decided to slightly slightly change your solution so that ActionController::BadRequest is raised instead of ArgumentError, resulting in a 400 response to the client instead of 500.
@CofenseLabs-Doug 👍
@stas how about the other idea of having a way to configure jsonapi
, so as to set properties for Ransack at https://github.com/stas/jsonapi.rb/blob/master/lib/jsonapi/patches.rb#L3-L6
What is the current behavior?
https://github.com/stas/jsonapi.rb/issues/62
What is the new behavior?
It allows to use the
Ransack
configuration propertyignore_unkown_conditions
with the same semantics as in Ransack. A disadvantage of this solution is thatRansack
so far has been a dependency ofjsonapi.rb
, and not necessarily of the projects which useJsonapi.rb
. Somehow it could be considered a co-dependency ofjsonapi.rb
, but that is not up to me.Another solution would be to add a configuration object to
jsonapi.rb
.Checklist
Please make sure the following requirements are complete: