Commit 6bfc511e68ae3364bf754a39a78af9f39f1a9c8a
1 parent
30b7e5b6
Exists in
master
and in
1 other branch
Fix extract_backtraces migration, account for notices without backtrace
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
db/migrate/20121003223358_extract_backtraces.rb
| ... | ... | @@ -2,7 +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 | - backtrace = Backtrace.find_or_create(:raw => notice['backtrace']) | |
| 5 | + backtrace = Backtrace.find_or_create(:raw => notice['backtrace'].presence || []) | |
| 6 | 6 | notice.backtrace = backtrace |
| 7 | 7 | notice['backtrace'] = nil |
| 8 | 8 | notice.save! | ... | ... |