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

Give better error message for invalid nested defaults #311

Merged
merged 3 commits into from
Oct 16, 2015

Conversation

tfausak
Copy link
Collaborator

@tfausak tfausak commented Oct 15, 2015

This pull request changes the error message when you have an invalid nested default. Its goal is to make it clearer what the problem is. Issue #309 may have been avoided if something like this was in place.

Here is an example of the new message:

class Example < ActiveInteraction::Base
  hash :h,
    default: {} do
      boolean :b
    end
end
# ActiveInteraction::InvalidDefaultError: h: {} (b: nil)

@tfausak tfausak self-assigned this Oct 15, 2015
@tfausak
Copy link
Collaborator Author

tfausak commented Oct 15, 2015

The wording here could be a lot better.

@AaronLasseigne
Copy link
Owner

Looks good to me.

@tfausak
Copy link
Collaborator Author

tfausak commented Oct 15, 2015

Great! @elfassy, how do you feel about this pull request? Would it have helped you understand what was going on with hash defaults?

@elfassy
Copy link

elfassy commented Oct 16, 2015

👍

tfausak added a commit that referenced this pull request Oct 16, 2015
Give better error message for invalid nested defaults
@tfausak tfausak merged commit f38127f into master Oct 16, 2015
@tfausak tfausak deleted the gh-309-hash-default branch October 16, 2015 13:01
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.

3 participants