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.