<commit_before>class Store < ActiveRecord::Base
  belongs_to :user
  has_many :products, :order => 'updated_at DESC'
  has_many :orders, :order => 'updated_at DESC'
  extend FriendlyId

  friendly_id :name, :use => [:slugged, :history]

  attr_accessible :name, :return_policy, :terms_of_service
  validates_presence_of :name, :return_policy
  validates_uniqueness_of :name
  validates_acceptance_of :terms_of_service, :on => :create

  def displayable_products
    self.products.reject { |product| product.status == 'Draft' }
  end
end<commit_msg>adding dependent => destroy to products<commit_after>class Store < ActiveRecord::Base
  belongs_to :user
  has_many :products, :order => 'updated_at DESC', :dependent => :destroy
  has_many :orders, :order => 'updated_at DESC'
  extend FriendlyId

  friendly_id :name, :use => [:slugged, :history]

  attr_accessible :name, :return_policy, :terms_of_service
  validates_presence_of :name, :return_policy
  validates_uniqueness_of :name
  validates_acceptance_of :terms_of_service, :on => :create

  def displayable_products
    self.products.reject { |product| product.status == 'Draft' }
  end
end
{'fraction_non_alphanumeric': 0.1055846422338569, 'fraction_numerical': 0.0, 'mean_word_length': 5.630057803468208, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2086192', 'n_tokens_mistral': 389, 'n_tokens_neox': 380, 'n_words': 91}