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

Only load permitted attributes once #11

Merged
merged 1 commit into from
May 29, 2017
Merged

Conversation

qr8r
Copy link
Contributor

@qr8r qr8r commented May 22, 2017

Previous Behaviour:
The to_prepare block was reloading the permitted attributes module. This
resulted in the subscription parameters being appended to the spree
premitted attributes multiple times.

New behaviour:
Do not auto load the lib directory
Only load the permitted attributes once during the initalization process


initializer 'solidus_subscriptions.configs', before: "spree.register.payment_methods" do
initializer 'require subscription lib helpers' do
require 'solidus_subscriptions/permitted_attributes'
Copy link

Choose a reason for hiding this comment

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

Are you requiring this line twice? Why do we need an initializer block for requiring files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I didnt mean to add it in twice. You might be right. I wasnt sure if it was better to require this in an initializer or simple at the top of the engine along side spree/core.

I think I prefer the latter, so I will make that change :)

Previous Behaviour:
The to_prepare block was reloading the permitted attributes module. This
resulted in the subscription parameters being appended to the spree
premitted attributes multiple times.

New behaviour:
Do not auto load the lib directory
Only load the permitted attributes once during the initalization process
@qr8r qr8r force-pushed the duplicated_permitted_attributes branch from c401903 to c61f4d6 Compare May 23, 2017 12:47
@qr8r qr8r merged commit 0c5e587 into master May 29, 2017
@qr8r qr8r deleted the duplicated_permitted_attributes branch May 29, 2017 16:03
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.

2 participants