Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ModDniNoNil < ActiveRecord::Migration
- def self.up
- User.find(:all).each {|user|
- if user.dni.nil?
- user.dni=""
- if user.save_without_validation
- puts "#{user.login} dni cambiado"
- end
- end
- }
- end
- def self.down
- end
- end
Add Comment
Please, Sign In to add comment