cleaning up touches

This commit is contained in:
Will Marshall
2014-07-02 13:17:54 +10:00
committed by Rohan Mitchell
parent 24d3abf6d5
commit 3195e20b65
5 changed files with 31 additions and 34 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"