grape-entity icon indicating copy to clipboard operation
grape-entity copied to clipboard

Safe behavior (question)

Open glaucocustodio opened this issue 8 years ago • 0 comments

Hi folks. Given the following entity:

expose :name
expose :address
  expose :street, safe: true do |instance, _|
    instance.address.street
  end
end

If address is nil, safe: true is supposed to make street return nil instead of an exception? It's returning undefined method street for nil:NilClass.

glaucocustodio avatar Nov 16 '17 13:11 glaucocustodio