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 e3215fd commit 2dcc162Copy full SHA for 2dcc162
lib/tasks/db.rake
@@ -216,6 +216,7 @@ namespace :db do
216
217
task :protips => :connect do
218
Protip.reset_pk_sequence
219
+ not_ported = []
220
Legacy[:protips].where(port_data_since).each do |row|
221
puts "#{row[:id]} : #{row[:public_id]} : #{row[:slug]}"
222
protip = Protip.find_or_initialize_by_id(row[:id])
@@ -234,9 +235,12 @@ namespace :db do
234
235
236
protip.flagged = row[:inappropriate].to_i > 0
237
- protip.save!
238
+ if !protip.save
239
+ not_ported << protip
240
+ end
241
end
242
243
+ puts "Failed to port #{not_ported.size}"
244
245
246
0 commit comments