Skip to main content

How do I remove Devise::Trackable from my app?

Gems / Libraries • Asked by Daniel Weaver

I'd like to remove the Trackable module of Devise.

Is it as simple as removing :trackable from the devise line in User.rb and then creating a migration to remove the columns created for the module?

# User.rb
devise :database_authenticatable, :registerable, :rememberable, :validatable, :trackable
# becomes
devise :database_authenticatable, :registerable, :rememberable, :validatable

and migration like:

def change
  remove_column :users, :sign_in_count
  remove_column :users, :current_sign_in_at
  remove_column :users, :last_sign_in_at
  remove_column :users, :current_sign_in_ip
  remove_column :users, :last_sign_in_ip

I could just disable it but if I'm not going ot be using it at all I'd prefer to remove it entirely.

Yep, that should be it. You don't have to remove the columns, but you might as well if you don't need the data.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.