Ask A Question

Notifications

You’re not receiving notifications from this thread.

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

Daniel Weaver asked in Gems / Libraries

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
end

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

Reply

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.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.