Merge branch 'master' into enterprises

Conflicts:
	app/controllers/enterprises_controller.rb
	app/views/spree/checkout/_distributor.html.haml
	db/schema.rb
	spec/lib/open_food_web/group_buy_report_spec.rb
This commit is contained in:
Rohan Mitchell
2012-11-01 11:02:02 +11:00
23 changed files with 945 additions and 36 deletions

View File

@@ -0,0 +1,21 @@
class ChangeGroupBuyUnitSizeFromStringToFloat < ActiveRecord::Migration
class Spree::Product < ActiveRecord::Base; end
def up
add_column :spree_products, :group_buy_unit_size_f, :float
Spree::Product.reset_column_information
Spree::Product.all.each do |product|
product.group_buy_unit_size_f = product.group_buy_unit_size.to_f
product.save!
end
remove_column :spree_products, :group_buy_unit_size
rename_column :spree_products, :group_buy_unit_size_f, :group_buy_unit_size
end
def down
change_column :spree_products, :group_buy_unit_size, :string
end
end

View File

@@ -490,7 +490,7 @@ ActiveRecord::Schema.define(:version => 20121031222403) do
t.integer "count_on_hand", :default => 0, :null => false
t.integer "supplier_id"
t.boolean "group_buy"
t.string "group_buy_unit_size"
t.float "group_buy_unit_size"
end
add_index "spree_products", ["available_on"], :name => "index_products_on_available_on"