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

Avoid loading models when requiring factories #2369

Merged
merged 2 commits into from
Nov 10, 2017

Conversation

jhawthorn
Copy link
Contributor

This makes some minor changes to the adjustment, customer_return, stock, and store_credit_type factories so that they don't need their models autoloaded in order to be used.

It also makes some more substatial changes to the user model for the same purpose.

This was checking Spree.user_class as soon as it was required, which
might not yet have the correct user_class.

It also had a bunch of behaviour intended for some (lost to time) custom
auth implementation. Any such customizations should be done in the app
or extension instead.
Not a huge deal, but we should avoid loading the targets of these
factories until they are explcitly run.
@jhawthorn jhawthorn force-pushed the avoid_models_on_factory_load branch from cef6a1f to a418587 Compare November 10, 2017 00:37
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@cbrunsdon cbrunsdon left a comment

Choose a reason for hiding this comment

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

Thanks Hawth, I can't remember if I legit missed these in #2230 or was too lazy to make any real changes.

@jhawthorn jhawthorn merged commit 56fcb5c into solidusio:master Nov 10, 2017
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.

4 participants