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

Improve invalid nested value error message #256

Merged
merged 1 commit into from
Feb 10, 2015
Merged

Improve invalid nested value error message #256

merged 1 commit into from
Feb 10, 2015

Conversation

tfausak
Copy link
Collaborator

@tfausak tfausak commented Feb 9, 2015

This pull request is in response to #255. When you define a hash with default: {}, we eagerly build the default value. If one of the inputs inside that hash doesn't have a default, you'll get an error. For example:

class Example < ActiveInteraction::Base
  hash :x, default: {} do
    string :y
  end
end
# ActiveInteraction::InvalidNestedValueError: ActiveInteraction::InvalidNestedValueError

Since there's no error message, it's basically useless. This pull request adds a message to that error. Now it looks like this:

class Example < ActiveInteraction::Base
  hash :x, default: {} do
    string :y
  end
end
# ActiveInteraction::InvalidNestedValueError: y: nil

Can you review this, @AaronLasseigne?

@tfausak tfausak self-assigned this Feb 9, 2015
@AaronLasseigne
Copy link
Owner

:shipit:

@tfausak tfausak merged commit 9b0b0ac into master Feb 10, 2015
@tfausak tfausak deleted the gh-255 branch February 10, 2015 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants