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 touching all products associated with existing option type imported #70

Open
kennyadsl opened this issue Jun 16, 2021 · 1 comment
Labels
bug Something isn't working stale

Comments

@kennyadsl
Copy link
Member

Currently, when importing a product that has a specific option type, all existing products associated with that option type are touched.

This is happening because we are doing these operations at each product import:

option_type = Spree::OptionType.find_or_initialize_by(
name: name.parameterize
)
option_type.presentation ||= name
option_type.position = i + 1
option_type.save!

I think we should try to change the option type only if needed. It is not even clear why we need to update its position, since that position is a global value against other option types and not something specific for the product imported.

@kennyadsl kennyadsl added the bug Something isn't working label Jun 16, 2021
@stale
Copy link

stale bot commented Aug 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant