Sha256: c268c32515e7183cbc2c53b83de1a6a70095bd6a739be3651323a47863491615
Contents?: true
Size: 880 Bytes
Versions: 11
Compression:
Stored size: 880 Bytes
Contents
class AddAddressFieldsToStockLocation < ActiveRecord::Migration def change remove_column :spree_stock_locations, :address_id add_column :spree_stock_locations, :address1, :string add_column :spree_stock_locations, :address2, :string add_column :spree_stock_locations, :city, :string add_column :spree_stock_locations, :state_id, :integer add_column :spree_stock_locations, :state_name, :string add_column :spree_stock_locations, :country_id, :integer add_column :spree_stock_locations, :zipcode, :string add_column :spree_stock_locations, :phone, :string usa = Spree::Country.where(iso: 'US').first # In case USA isn't found. # See https://github.com/spree/spree/issues/3115 country = usa || Spree::Country.first Spree::Country.reset_column_information Spree::StockLocation.update_all(country_id: country) end end
Version data entries
11 entries across 11 versions & 1 rubygems