cirandas.net

ref: master

db/migrate/20120813163139_set_activation_code_to_nil_if_already_activated.rb


1
2
3
4
5
6
7
8
9
class SetActivationCodeToNilIfAlreadyActivated < ActiveRecord::Migration
  def self.up
    update("UPDATE users SET activation_code = null WHERE activated_at IS NOT NULL")
  end

  def self.down
    say('Can not be reverted.')
  end
end