I have the following check for nil:
client = !deal['deal']['party']['party'].nil? ? deal['deal']['party']['party']['company_id'] : ""
but still I get:
You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[]
How can I prevent this?