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

Print errors #301

Closed
wants to merge 3 commits into from
Closed

Conversation

dshinzie-zz
Copy link
Contributor

This is for issue #294. The problem was that Active Record errors are actually from class ActiveModel::Errors instead of ActiveRecord::Base.

  • Casting type check was added in method cast_with_active_record in active_record.rb
  • New method awesome_active_model_error was added to deal with Active Model Errors
  • A marshal_dump was used in order to use a similar column check as method awesome_active_record_instance. The two methods definitely look very similar, but I simply made a new method instead of possibly breaking an existing one
  • Since the Error class consists of base, details, and messages, the latter two must be merged into order to make the final Awesome hash

@thiagofm
Copy link
Collaborator

Can you please rebase?

@imajes
Copy link
Collaborator

imajes commented Nov 7, 2017

@dshinzie: can i convince you to add a quick spec for this too? this is a really worthwhile PR; would love to get it merged into the next release, please!

@imajes
Copy link
Collaborator

imajes commented Jan 9, 2019

this is useful so i've pulled in the relevant commits. will look into specs at a later date.

@imajes imajes closed this Jan 9, 2019
@dshinzie-zz
Copy link
Contributor Author

nice man!

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.

4 participants