All threads / How do I remove Devise::Trackable from my app?

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.

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.

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.