Started GET "/api/v1/employees?filter[first_name][eq]=null" for ::1 at 2021-08-13 16:52:50 -0500
Processing by EmployeesController#index as JSONAPI
Parameters: {"filter"=>{"first_name"=>{"eq"=>"null"}}}
Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms)
NoMethodError (undefined method `downcase' for nil:NilClass):
app/controllers/employees_controller.rb:3:in `index'
Entering null in Integer columns like age and team_id work as expected.
The problem seems to stem from line 43 in this method
I also noticed there was a test for null values in a String field this that is passing. I assume this is still passing because the test adapter doesn't use the same filter methods that are in the active_record adapter.
I edited the example employee directory app to allow nil values for each employee field—
When I try to enter
null
in Vandal I get an errorEntering
null
in Integer columns likeage
andteam_id
work as expected.The problem seems to stem from line 43 in this method
https://github.com/graphiti-api/graphiti/blob/7991740b40f9ec32f017cd90d298388f42a6c94a/lib/graphiti/adapters/active_record.rb#L41-L45
I also noticed there was a test for
null
values in a String field this that is passing. I assume this is still passing because the test adapter doesn't use the same filter methods that are in the active_record adapter.