Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe behavior (question) #285

Open
glaucocustodio opened this issue Nov 16, 2017 · 0 comments
Open

Safe behavior (question) #285

glaucocustodio opened this issue Nov 16, 2017 · 0 comments

Comments

@glaucocustodio
Copy link
Contributor

glaucocustodio commented Nov 16, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant