<commit_before>module Spree
  class OptionValue < Spree::Base
    belongs_to :option_type, class_name: 'Spree::OptionType', touch: true, inverse_of: :option_values
    acts_as_list scope: :option_type

    has_many :option_values_variants, dependent: :destroy
    has_many :variants, through: :option_values_variants

    validates :name, presence: true, uniqueness: { scope: :option_type_id }
    validates :presentation, presence: true

    after_touch :touch_all_variants

    # Updates the updated_at column on all the variants associated with this
    # option value.
    def touch_all_variants
      variants.update_all(updated_at: Time.current)
    end

    # @return [String] a string representation of all option value and its
    #   option type
    def presentation_with_option_type
      "#{self.option_type.presentation} - #{self.presentation}"
    end
  end
end<commit_msg>Remove touch from option_value to option_type.<commit_after>module Spree
  class OptionValue < Spree::Base
    belongs_to :option_type, class_name: 'Spree::OptionType', inverse_of: :option_values
    acts_as_list scope: :option_type

    has_many :option_values_variants, dependent: :destroy
    has_many :variants, through: :option_values_variants

    validates :name, presence: true, uniqueness: { scope: :option_type_id }
    validates :presentation, presence: true

    after_save :touch
    after_touch :touch_all_variants

    # Updates the updated_at column on all the variants associated with this
    # option value.
    def touch_all_variants
      variants.find_each(&:touch)
    end

    # @return [String] a string representation of all option value and its
    #   option type
    def presentation_with_option_type
      "#{self.option_type.presentation} - #{self.presentation}"
    end
  end
end
{'fraction_non_alphanumeric': 0.07341490545050056, 'fraction_numerical': 0.0, 'mean_word_length': 4.096317280453258, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3815467', 'n_tokens_mistral': 544, 'n_tokens_neox': 527, 'n_words': 153}