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

explicitly sent nil values should be converted to a default if provided #38

Closed
AaronLasseigne opened this issue Jul 29, 2013 · 1 comment
Assignees
Milestone

Comments

@AaronLasseigne
Copy link
Owner

class Foo < ActiveInteraction::Base
  string :query, default: ''

  def execute; end
end

Foo.run(query: nil).errors.full_messages
["Query is required"]

There are times where a parameter is not posted to the page and the interaction has a default for it. Does it make sense to view an explicitly provided nil as permission to use the default?

@tfausak
Copy link
Collaborator

tfausak commented Jul 30, 2013

Yeah, I think passing in nil should be interpreted the same as not passing anything.

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

No branches or pull requests

2 participants