Sha256: d5a453af1d4738c0dc76a3ba68fca8009aaae495ac5eb487a6410f72ca730e51

Contents?: true

Size: 254 Bytes

Versions: 55

Compression:

Stored size: 254 Bytes

Contents

class PreventNilEmail < ActiveRecord::Migration
  def self.up
    execute("update orders set email = 'guest@example.com' where email is null")
    execute("update orders set email = 'guest@example.com' where email = ''")
  end

  def self.down
  end
end

Version data entries

55 entries across 43 versions & 9 rubygems

Version Path
spree_core-0.70.7 db/migrate/20101026184932_prevent_nil_email.rb
spree_core-0.70.6 db/migrate/20101026184932_prevent_nil_email.rb
apispree_core-0.0.0 db/migrate/20101026184932_prevent_nil_email.rb
My-Commerce_core-1.1.0 db/migrate/20101026184932_prevent_nil_email.rb
My-Commerce_core-1.0.0 db/migrate/20101026184932_prevent_nil_email.rb
MyCommerceapi-1.0.0 api/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerceapi-1.0.0 dash/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerceapi-1.0.0 promo/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerceapi-1.0.0 core/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerceapi-1.0.0 auth/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerceapi-1.0.0 core/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerceapi-1.0.0 sandbox/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerce-0.0.3 promo/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerce-0.0.3 core/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerce-0.0.3 auth/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerce-0.0.3 dash/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerce-0.0.3 core/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerce-0.0.3 api/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb
MyCommerce-0.0.3 sandbox/db/migrate/20101026184932_prevent_nil_email.rb
rfcommerce_sandbox-0.0.3 db/migrate/20101026184932_prevent_nil_email.rb