Skip to content
Janko Marohnić edited this page Jan 7, 2025 · 1 revision

If you want to know when an external identity was used first or last, you may want to add timestamp columns to the identities table:

create_table :account_identities do |t|
  # ...
  t.timestamps
end

In that case, you'll need to make sure the column values are populated on create/update:

omniauth_identity_insert_hash { super().merge(created_at: Time.now) }
omniauth_identity_update_hash { { updated_at: Time.now } }
Clone this wiki locally