mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
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:
@@ -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
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user