We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94f16e2 commit b57e83fCopy full SHA for b57e83f
lib/tasks/db.rake
@@ -100,17 +100,21 @@ namespace :db do
100
101
task :comments => :connect do
102
Comment.reset_pk_sequence
103
+ not_ported = []
104
Legacy[:comments].where(port_data_since).each do |row|
105
if row[:comment].to_s.size >= 2
106
comment = Comment.find_or_initialize_by_id(row[:id])
107
comment.attributes.except(:comment).keys.each do |key|
108
comment[key] = row[key.to_sym]
109
end
110
comment.body = row[:comment]
- comment.save!
111
+ if !comment.save
112
+ not_ported << comment
113
+ end
114
115
116
117
+ puts "Failed to port #{not_ported.size}"
118
119
120
task :teams => :connect do
0 commit comments