Permalink
Browse files

fix tags migration.

  • Loading branch information...
1 parent a9b7985 commit 910cd7a24c394eeb6f9328c0ef33b89b53646b65 @chloerei committed Oct 31, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 script/migration.rb
View
@@ -68,13 +68,13 @@ class Topic
begin
user = User.new :name => old_user.username,
:email => old_user.email,
- :locale => old_user.locale,
- :favorite_tags => old_user.favorite_tags
+ :locale => old_user.locale
user.id = old_user.id
user.created_at = old_user.created_at
user.crypted_password = old_user.crypted_password
user.password_salt = old_user.password_salt
user.access_token = old_user.access_token
+ user.favorite_tags = old_user.favorite_tags.to_a
user.save!(:validate => false)
rescue => e
puts e
@@ -94,6 +94,7 @@ class Topic
topic.user = User.find(old_topic.user_id)
topic.created_at = old_topic.created_at
topic.actived_at = old_topic.actived_at
+ topic.tags = old_topic.tags.to_a
topic.save!
rescue => e
puts e

0 comments on commit 910cd7a

Please sign in to comment.