Sivarg

You know what really grinds my gears ?

If you were using clearance 0.3.X and want to upgrade to 0.4.X, the generator should help a little. Nevertheless, you should use this migration instead :


class CreateOrUpdateUsersWithClearanceColumns < ActiveRecord::Migration
def self.up
change_table(:users) do |t|
t.rename :crypted_password, :encrypted_password
t.rename :confirmed, :email_confirmed
end
remove_index :users, :name => "index_users_on_email_and_crypted_password"
add_index :users, [:email, :encrypted_password], :name => "index_users_on_email_and_encrypted_password"
end

def self.down
change_table(:users) do |t|
t.rename :encrypted_password, :crypted_password
t.rename :email_confirmed, :confirmed
end
remove_index :users, :name => "index_users_on_email_and_encrypted_password"
add_index :users, [:email, :crypted_password], :name => "index_users_on_email_and_crypted_password"

end
end


Be sure to rename all your login* methods to the new sign* naming convention.

0 comments:

About this blog

A nice techno-tale !