Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include additional data from devise users #3

Open
jdunck opened this issue Jul 28, 2015 · 2 comments
Open

Include additional data from devise users #3

jdunck opened this issue Jul 28, 2015 · 2 comments

Comments

@jdunck
Copy link
Collaborator

jdunck commented Jul 28, 2015

current_sign_in_at and last_sign_in_at are available by default on devise models. We should extract that info (failing gracefully).

@jdunck
Copy link
Collaborator Author

jdunck commented Jul 28, 2015

Here's the default devise model:

create_table(:users) do |t|
  ## Database authenticatable
  t.string :email,              null: false, default: ""
  t.string :encrypted_password, null: false, default: ""

  ## Recoverable
  t.string   :reset_password_token
  t.datetime :reset_password_sent_at

  ## Rememberable
  t.datetime :remember_created_at

  ## Trackable
  t.integer  :sign_in_count, default: 0, null: false
  t.datetime :current_sign_in_at
  t.datetime :last_sign_in_at
  t.string   :current_sign_in_ip
  t.string   :last_sign_in_ip

  ## Confirmable
  # t.string   :confirmation_token
  # t.datetime :confirmed_at
  # t.datetime :confirmation_sent_at
  # t.string   :unconfirmed_email # Only if using reconfirmable

  ## Lockable
  # t.integer  :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
  # t.string   :unlock_token # Only if unlock strategy is :email or :both
  # t.datetime :locked_at


  t.timestamps null: false
end

@andrewberls
Copy link
Contributor

This is of course a good idea, but I'm very unsure/curious how prevalent devise actually is in companies at any meaningful scale - I've never encountered it, but have also worked on < 10 production scale rails deployments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants