Commit adc5d82c5852c6a6b6d64c96e39b5e4d4452e82b
1 parent
804bc020
Exists in
master
and in
1 other branch
Check backtrace on migration - issue #540
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
db/migrate/20121003223358_extract_backtraces.rb
... | ... | @@ -2,6 +2,7 @@ class ExtractBacktraces < Mongoid::Migration |
2 | 2 | def self.up |
3 | 3 | say "It could take long time (hours if you have many Notices)" |
4 | 4 | Notice.unscoped.all.each do |notice| |
5 | + next if notice.backtrace.present? || notice['backtrace'].nil? | |
5 | 6 | backtrace = Backtrace.find_or_create(:raw => notice['backtrace'] || []) |
6 | 7 | notice.backtrace = backtrace |
7 | 8 | notice['backtrace'] = nil |
... | ... | @@ -12,4 +13,4 @@ class ExtractBacktraces < Mongoid::Migration |
12 | 13 | |
13 | 14 | def self.down |
14 | 15 | end |
15 | 16 | -end |
17 | +end | |
16 | 18 | \ No newline at end of file | ... | ... |