From b005d0860edb679c806b24d5db5485784dc86ab9 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 2 Jul 2014 13:17:54 +1000 Subject: [PATCH] cleaning up touches --- app/models/enterprise.rb | 2 +- app/models/spree/classification_decorator.rb | 1 - app/models/spree/product_decorator.rb | 1 - app/serializers/api/enterprise_serializer.rb | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index d42031273d..5b922b15e4 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -7,7 +7,7 @@ class Enterprise < ActiveRecord::Base has_many :producer_properties, foreign_key: 'producer_id' has_many :supplied_products, :class_name => 'Spree::Product', :foreign_key => 'supplier_id', :dependent => :destroy has_many :distributed_orders, :class_name => 'Spree::Order', :foreign_key => 'distributor_id' - belongs_to :address, :class_name => 'Spree::Address', touch: true + belongs_to :address, :class_name => 'Spree::Address' has_many :product_distributions, :foreign_key => 'distributor_id', :dependent => :destroy has_many :distributed_products, :through => :product_distributions, :source => :product has_many :enterprise_fees diff --git a/app/models/spree/classification_decorator.rb b/app/models/spree/classification_decorator.rb index 8fa201528c..c69eb01fcf 100644 --- a/app/models/spree/classification_decorator.rb +++ b/app/models/spree/classification_decorator.rb @@ -1,6 +1,5 @@ Spree::Classification.class_eval do belongs_to :product, :class_name => "Spree::Product", touch: true - belongs_to :taxon, :class_name => "Spree::Taxon", touch: true before_destroy :dont_destroy_if_primary_taxon def dont_destroy_if_primary_taxon diff --git a/app/models/spree/product_decorator.rb b/app/models/spree/product_decorator.rb index 0f61011fcd..65b717b8b6 100644 --- a/app/models/spree/product_decorator.rb +++ b/app/models/spree/product_decorator.rb @@ -5,7 +5,6 @@ Spree::Product.class_eval do has_many :option_types, :through => :product_option_types, :dependent => :destroy belongs_to :supplier, :class_name => 'Enterprise', touch: true - belongs_to :primary_taxon, class_name: 'Spree::Taxon', touch: true has_many :product_distributions, :dependent => :destroy has_many :distributors, :through => :product_distributions diff --git a/app/serializers/api/enterprise_serializer.rb b/app/serializers/api/enterprise_serializer.rb index c643bf5b21..c929bf2c55 100644 --- a/app/serializers/api/enterprise_serializer.rb +++ b/app/serializers/api/enterprise_serializer.rb @@ -4,7 +4,6 @@ class Api::EnterpriseSerializer < ActiveModel::Serializer # Taxons: # classifications touch products # products touch suppliers - # Taxon could change but unlikely: if becomes a problem dereference # # Relatives: # Enterprise_relationships touches parent, child