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

Use Rails 5-style detailed errors #276

Merged
merged 5 commits into from
Apr 29, 2015
Merged

Use Rails 5-style detailed errors #276

merged 5 commits into from
Apr 29, 2015

Conversation

tfausak
Copy link
Collaborator

@tfausak tfausak commented Apr 24, 2015

Fixes #250.

@tfausak tfausak self-assigned this Apr 24, 2015
@tfausak tfausak added this to the v2.0.0 milestone Apr 24, 2015
@tfausak
Copy link
Collaborator Author

tfausak commented Apr 24, 2015

This build failed because active_model-errors_details depends on activemodel >= 4.0, whereas active_interaction depends on activemodel ~> 3.2.

@tfausak
Copy link
Collaborator Author

tfausak commented Apr 24, 2015

I am now waiting on cowbell/active_model-errors_details#2 to add support for Rails 3.2.

@tfausak
Copy link
Collaborator Author

tfausak commented Apr 28, 2015

My pull request was merged and released as v1.2.0. However it requires ActiveModel >=3.2.13, whereas we require ActiveModel >=3.2.0.

The latest version (1.2.0) of active_model-errors_details requires
a newer version (3.2.13) of activemodel than we do.

This commit embeds the source of active_model-errors_details to
avoid the dependency conflict. Note that it's not exactly the same.
I modified it in two notable ways:

1.  I removed the backwards-compatible #deep_dup. Whatever ActiveModel
    uses is sufficient for us.

2.  I cleaned up and refactored the source a little.
@tfausak
Copy link
Collaborator Author

tfausak commented Apr 28, 2015

39f2dd7 added 3.2.0-compatible support for the detailed errors.

@tfausak
Copy link
Collaborator Author

tfausak commented Apr 29, 2015

I realized that this is technically a backport, so I moved it into the backports file.


%w[initialize initialize_dup add clear delete].each do |method|
alias_method "#{method}_without_details", method
alias_method method, "#{method}_with_details"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alias_method_chain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

At some point along the way, it was not working for me. Now it is. I am not sure what changed.

@AaronLasseigne
Copy link
Owner

We need to update the README to reflect these changes. (probably for some of the other 2.0 stuff as well)

@AaronLasseigne
Copy link
Owner

Code wise it's a :shipit:.

@tfausak
Copy link
Collaborator Author

tfausak commented Apr 29, 2015

I'll update the v2.0.0 documentation in a separate branch.

@tfausak tfausak merged commit 45eb553 into v2.0.0 Apr 29, 2015
@tfausak tfausak deleted the gh-250 branch April 29, 2015 21:57
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