Permalink
Browse files

add email case migration

git-svn-id: http://svn.techno-weenie.net/projects/beast/trunk@3035 567b1171-46fb-0310-a4c9-b4bef9110e78
  • Loading branch information...
1 parent a0b490f commit 45137ef6d280d218f6ee265462a119338164de96 technoweenie committed Nov 1, 2007
Showing with 11 additions and 0 deletions.
  1. +11 −0 db/migrate/053_downcase_all_emails.rb
@@ -0,0 +1,11 @@
+class DowncaseAllEmails < ActiveRecord::Migration
+ class User < ActiveRecord::Base; end
+ def self.up
+ User.paginated_each :select => 'id, email' do |user|
+ User.update_all ['email = ?', user.email.downcase], ['id = ?', user.id] unless user.email.blank?
+ end
+ end
+
+ def self.down
+ end
+end

0 comments on commit 45137ef

Please sign in to comment.