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 443a9dd8a9..6de297cba9 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 diff --git a/app/views/producers/index.haml b/app/views/producers/index.haml index 5cde67a512..2d4c834191 100644 --- a/app/views/producers/index.haml +++ b/app/views/producers/index.haml @@ -1,35 +1,35 @@ = inject_enterprises -.producers{"ng-controller" => "ProducersCtrl"} - .row - .small-12.columns.text-center.pad-top - %h1 Producers - %div - Select a - %ofn-modal{title: "producer"} - = render partial: "modals/producers" - from the list below: +-#.producers{"ng-controller" => "ProducersCtrl"} + -#.row + -#.small-12.columns.text-center.pad-top + -#%h1 Producers + -#%div + -#Select a + -#%ofn-modal{title: "producer"} + -#= render partial: "modals/producers" + -#from the list below: - #active-table-search.row.pad-top - .small-12.columns - %i.ofn-i_020-search - %input{type: :text, - "ng-model" => "query", - placeholder: "Search postcode, suburb or producer name...", - "ng-debounce" => "150", - "ofn-disable-enter" => true} + -##active-table-search.row.pad-top + -#.small-12.columns + -#%i.ofn-i_020-search + -#%input{type: :text, + -#"ng-model" => "query", + -#placeholder: "Search postcode, suburb or producer name...", + -#"ng-debounce" => "150", + -#"ofn-disable-enter" => true} - .row{bindonce: true} - .small-12.columns - .active_table - %producer.active_table_node.row.animate-repeat{id: "{{producer.path}}", - "scroll-after-load" => true, - "ng-repeat" => "producer in filteredProducers = (Producers.visible | filterProducers:query)", - "ng-controller" => "ProducerNodeCtrl", - "ng-class" => "{'closed' : !open(), 'open' : open(), 'inactive' : !producer.active}", - id: "{{producer.hash}}"} + -#.row{bindonce: true} + -#.small-12.columns + -#.active_table + -#%producer.active_table_node.row.animate-repeat{id: "{{producer.path}}", + -#"scroll-after-load" => true, + -#"ng-repeat" => "producer in filteredProducers = (Producers.visible | filterProducers:query)", + -#"ng-controller" => "ProducerNodeCtrl", + -#"ng-class" => "{'closed' : !open(), 'open' : open(), 'inactive' : !producer.active}", + -#id: "{{producer.hash}}"} - .small-12.columns - = render partial: 'producers/skinny' - = render partial: 'producers/fat' + -#.small-12.columns + -#= render partial: 'producers/skinny' + -#= render partial: 'producers/fat' -= render partial: "shared/footer" +-#= render partial: "shared/footer"