Guest User

Untitled

a guest
Jun 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class ModDniNoNil < ActiveRecord::Migration
  2. def self.up
  3. User.find(:all).each {|user|
  4. if user.dni.nil?
  5. user.dni=""
  6. if user.save_without_validation
  7. puts "#{user.login} dni cambiado"
  8. end
  9. end
  10. }
  11. end
  12.  
  13. def self.down
  14. end
  15. end
Add Comment
Please, Sign In to add comment