Skip to content

Avoid touching all products associated with existing option type imported #70

@kennyadsl

Description

@kennyadsl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions