Skip to content
This repository
Browse code

Retain Mongo IDs when duplicating users for each app

This means that the relationships between e.g. Users and Editions,
and Users and Actions is preserved.
  • Loading branch information...
commit 45e4bacea0e6ca5a1ff1e7cad982381cb76901ad 1 parent 76d6d65
Jamie Cobbett authored August 20, 2012

Showing 1 changed file with 2 additions and 3 deletions. Show diff stats Hide diff stats

  1. 5  lib/tasks/migrate.rake
5  lib/tasks/migrate.rake
@@ -57,9 +57,8 @@ namespace :migrate do
57 57
     end
58 58
 
59 59
     User.all.each do |user|
60  
-      to_keep = user.attributes.reject { |field_name, value| ["_id"].include?(field_name) }
61  
-      PanopticonUser.timeless.create!(to_keep)
62  
-      PublisherUser.timeless.create!(to_keep)
  60
+      PanopticonUser.timeless.create!(user.attributes)
  61
+      PublisherUser.timeless.create!(user.attributes)
63 62
     end
64 63
   end
65 64
 

0 notes on commit 45e4bac

Please sign in to comment.
Something went wrong with that request. Please try again.