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

Load email validator from core instead of order #2669

Merged
merged 1 commit into from
Apr 4, 2018

Conversation

jhawthorn
Copy link
Contributor

It may be desirable to use the email validator from elsewhere before order.rb has been loaded.

Additionally, this fixes an issue where EmailValidator would be unloaded in development mode. Spree::Order is autoloaded, and because Spree::EmailValidator is inside the same namespace, this confuses rails into thinking Spree::EmailValidator was defined in this file and can be reloaded. I believe this to be a bug in rails.

It may be desirable to use the email validator from elsewhere before
order.rb has been loaded.

Additionally, this fixes an issue where EmailValidator would be unloaded
in development mode. Spree::Order is autoloaded, and because
Spree::EmailValidator is inside the same namespace, this confuses rails
into thinking Spree::EmailValidator was defined in this file and can be
reloaded. I believe this to be a bug in rails.
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks John!

@jhawthorn
Copy link
Contributor Author

For anyone curious I do think this is a rails bug and spent some time yesterday evening making a test case for it jhawthorn/rails@cf9c10e

@jhawthorn jhawthorn merged commit 5dd03bc into solidusio:master Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants