Sha256: c6b6cb7eb867421c92c4fdd190e39021afcc9eb1708c81b0c8a24e6aea83122d
Contents?: true
Size: 474 Bytes
Versions: 28
Compression:
Stored size: 474 Bytes
Contents
class GenerateAnonymousUsers < ActiveRecord::Migration def up Spree::User.table_name = 'users' Spree::Order.table_name = 'orders' Spree::User.reset_column_information Spree::Order.where(:user_id => nil).each do |order| user = Spree::User.anonymous! user.email ||= order.email order.user = user order.save! end Spree::User.table_name = 'spree_users' Spree::Order.table_name = 'spree_orders' end def down end end
Version data entries
28 entries across 28 versions & 3 rubygems