diff --git a/db/migrate/20150422124519_clean_unused_mobile_phones.rb b/db/migrate/20150422124519_clean_unused_mobile_phones.rb index 9e241f5..a7e0c26 100644 --- a/db/migrate/20150422124519_clean_unused_mobile_phones.rb +++ b/db/migrate/20150422124519_clean_unused_mobile_phones.rb @@ -3,7 +3,11 @@ def self.up # this will run the before_validation check and clean up # users which have a mobile_suffix and mobile_prefix filled even if not needed Account.all.each do |user| - user.save! + if user.valid? + user.save + else + puts "Problems with user: #{user.username}, id: #{user.id},\nerrors: #{user.errors}\n\n" + end end end