From 79393476b040707d52bcd182e26ae5fe9ddc6ce4 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Sat, 24 May 2014 09:07:56 +1000 Subject: [PATCH] Revert "Adding primary taxon to admin forms" This reverts commit 110a6f2d14a8ecb09628abf76f2836a275ff6777. --- .../admin/products/_form/add_notes_field.html.haml.deface | 1 + db/migrate/20140522044009_add_primary_taxon_to_products.rb | 2 -- db/schema.rb | 2 -- spec/features/admin/products_spec.rb | 6 ------ 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/overrides/spree/admin/products/_form/add_notes_field.html.haml.deface b/app/overrides/spree/admin/products/_form/add_notes_field.html.haml.deface index dcc7937d6b..dadebd01d4 100644 --- a/app/overrides/spree/admin/products/_form/add_notes_field.html.haml.deface +++ b/app/overrides/spree/admin/products/_form/add_notes_field.html.haml.deface @@ -4,3 +4,4 @@ = f.label :notes, t(:notes) = f.text_area :notes, { :class => 'fullwidth', rows: 5 } = f.error_message_on :notes + diff --git a/db/migrate/20140522044009_add_primary_taxon_to_products.rb b/db/migrate/20140522044009_add_primary_taxon_to_products.rb index f6ff3cfe96..ec8e3772b1 100644 --- a/db/migrate/20140522044009_add_primary_taxon_to_products.rb +++ b/db/migrate/20140522044009_add_primary_taxon_to_products.rb @@ -1,7 +1,5 @@ class AddPrimaryTaxonToProducts < ActiveRecord::Migration def change add_column :spree_products, :primary_taxon_id, :integer - add_index :spree_products, :primary_taxon_id - add_foreign_key :spree_products, :spree_taxons, column: :primary_taxon_id end end diff --git a/db/schema.rb b/db/schema.rb index 6005fd7cb5..69e79c2829 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -689,7 +689,6 @@ ActiveRecord::Schema.define(:version => 20140522044009) do add_index "spree_products", ["name"], :name => "index_products_on_name" add_index "spree_products", ["permalink"], :name => "index_products_on_permalink" add_index "spree_products", ["permalink"], :name => "permalink_idx_unique", :unique => true - add_index "spree_products", ["primary_taxon_id"], :name => "index_spree_products_on_primary_taxon_id" create_table "spree_products_promotion_rules", :id => false, :force => true do |t| t.integer "product_id" @@ -1094,7 +1093,6 @@ ActiveRecord::Schema.define(:version => 20140522044009) do add_foreign_key "spree_products", "enterprises", name: "spree_products_supplier_id_fk", column: "supplier_id" add_foreign_key "spree_products", "spree_shipping_categories", name: "spree_products_shipping_category_id_fk", column: "shipping_category_id" add_foreign_key "spree_products", "spree_tax_categories", name: "spree_products_tax_category_id_fk", column: "tax_category_id" - add_foreign_key "spree_products", "spree_taxons", name: "spree_products_primary_taxon_id_fk", column: "primary_taxon_id" add_foreign_key "spree_products_promotion_rules", "spree_products", name: "spree_products_promotion_rules_product_id_fk", column: "product_id" add_foreign_key "spree_products_promotion_rules", "spree_promotion_rules", name: "spree_products_promotion_rules_promotion_rule_id_fk", column: "promotion_rule_id" diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index b9fec1ef9f..b9f9d7a206 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -6,7 +6,6 @@ feature %q{ } do include AuthenticationWorkflow include WebHelper - let!(:taxon) { create(:taxon) } background do @supplier = create(:supplier_enterprise, :name => 'New supplier') @@ -23,7 +22,6 @@ feature %q{ fill_in 'product_name', with: 'A new product !!!' fill_in 'product_price', with: '19.99' - select taxon.name, from: "product_primary_taxon_id" select 'New supplier', from: 'product_supplier_id' click_button 'Create' @@ -45,8 +43,6 @@ feature %q{ product.reload product.distributors.sort.should == [@distributors[0], @distributors[2]].sort - - product.product_distributions.map { |pd| pd.enterprise_fee }.sort.should == [@enterprise_fees[0], @enterprise_fees[2]].sort end @@ -59,7 +55,6 @@ feature %q{ fill_in 'product_name', :with => 'A new product !!!' fill_in 'product_price', :with => '19.99' - select taxon.name, from: "product_primary_taxon_id" select 'New supplier', :from => 'product_supplier_id' choose 'product_group_buy_1' fill_in 'Group buy unit size', :with => '10' @@ -104,7 +99,6 @@ feature %q{ page.should have_selector('#product_supplier_id') select 'Another Supplier', :from => 'product_supplier_id' - select taxon.name, from: "product_primary_taxon_id" # Should only have suppliers listed which the user can manage within "#product_supplier_id" do