-
Notifications
You must be signed in to change notification settings - Fork 55
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
Make SimpleCommand::Errors compatible with ActiveModel::Errors #24
Comments
Hi @Hirurg103, I'm not associated with the simple_command project, but I gave this a look. I am not seeing this problem; I tried looking through the code and it appears to act the way you expect it to work. I wrote an rspec test to verify this behaviour, and it works as expected. I created a new Rails, wrote a Command that recreates the errors in your example, and it still behaved as expected. Have you found this issue to be resolved? or have I missed something while looking into it? |
I have missed something, not including I wrote a small gist that replicates this problem:
Output:
|
Hi @bmorrall , yes, this error is reproducible with pure |
This PR should fix that #25 |
I had the same issue, thanks for reporting and for the PR, hope they will merge it soon and release a new version. The bump from 0.0.9 would be a MAJOR release since we had break changes and not a minor how it was. |
After update to
v0.1.0
fromv0.0.9
tests started to fail withIn the controller errors are rendered the following way:
The problem is that
SimpleCommand::Errors#to_json
format differs fromActiveModel::Errors#to_json
It would be good to have
SimpleCommand::Errors#as_json
to be the same format asActiveModel::Errors#as_json
The text was updated successfully, but these errors were encountered: