Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c19beacae3
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (17 sloc) 0.371 kb
class GenerateAnonymousUsers < ActiveRecord::Migration
class Order < ActiveRecord::Base
end
class User < ActiveRecord::Base
end
def self.up
User.reset_column_information
Order.where(:user_id => nil).each do |order|
user = User.anonymous!
user.email ||= order.email
order.user = user
order.save!
end
end
def self.down
end
end
Jump to Line
Something went wrong with that request. Please try again.