Improved error handling. Also let migration working if already valid records are already in database (then skip this records).
This commit is contained in:
parent
b96c57210a
commit
553dcef3db
1 changed files with 1 additions and 0 deletions
|
@ -33,6 +33,7 @@ class CtiLogPreferencesMigration < ActiveRecord::Migration[5.0]
|
|||
# loop over all instances and covert them
|
||||
# to an Hash via .attributes
|
||||
updated = item.preferences[direction].each_with_object([]) do |caller_id, new_direction|
|
||||
next if !caller_id.respond_to?(:attributes)
|
||||
new_direction.push(caller_id.attributes)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue