-
-
Notifications
You must be signed in to change notification settings - Fork 465
Upgrading Clearance
croaky edited this page Apr 30, 2011
·
6 revisions
As of the 0.11.x series of Clearance, the following things are true:
- The way to protect your controller actions is via
before_filter :authorize, notbefore_filter :authenticate. - There is no email confirmation.
- There is no password confirmation.
- There is no dependency on dynamic_form.
- Email addresses are forced to lower case.
- The generators are namespaced by community convention:
rails g clearance:install,rails g clearance:features, andrails g clearance:views. - There are no Formtastic or Haml view generators.
- The email fields are all now of HTML5 type
email.
So, if you upgrading to the latest version of Clearance from an older version of Clearance, you may want to take at least some, if not all, of the following steps:
- Remove the
password_confirmationattribute from yourspec/factories.rbfile. - Remove the
password_confirmationfield from yourusers/newview. - Change
before_filter :authenticateeverywhere tobefore_filter :authorize. - Remove
form.error_messagesin any of your generatedusers/newandpasswords/editviews. - Re-generate the features:
rails g clearance:features. - Change the email fields in any of your generated
users/new,sessions/new, orpasswords/newviews. (necessary only to get features to pass)
Write a migration to downcase the existing emails in your users table:
class DowncaseEmails < ActiveRecord::Migration
def self.up
update "update users set email = LOWER(email)"
end
def self.down
end
end