{"id":15588511,"url":"https://github.com/brunoocasali/devise_last_seen","last_synced_at":"2025-10-26T08:10:47.652Z","repository":{"id":46654142,"uuid":"400840960","full_name":"brunoocasali/devise_last_seen","owner":"brunoocasali","description":"Ensure that devise will update a flag/timestamp on the model whenever a user is authenticated.","archived":false,"fork":false,"pushed_at":"2023-05-12T03:03:03.000Z","size":46,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T20:04:55.237Z","etag":null,"topics":["devise","devise-extensions","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brunoocasali.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-28T16:35:46.000Z","updated_at":"2025-03-21T08:49:00.000Z","dependencies_parsed_at":"2024-10-02T22:40:46.255Z","dependency_job_id":"4aa944a3-a418-470b-8d29-6ada7a1e272f","html_url":"https://github.com/brunoocasali/devise_last_seen","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.15000000000000002","last_synced_commit":"e0f4bc2cbc942c89ed73fda2889299fb5b3adfd6"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoocasali%2Fdevise_last_seen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoocasali%2Fdevise_last_seen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoocasali%2Fdevise_last_seen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunoocasali%2Fdevise_last_seen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunoocasali","download_url":"https://codeload.github.com/brunoocasali/devise_last_seen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250566440,"owners_count":21451228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devise","devise-extensions","rails","ruby"],"created_at":"2024-10-02T22:40:31.760Z","updated_at":"2025-10-26T08:10:42.628Z","avatar_url":"https://github.com/brunoocasali.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# devise_last_seen\n\nThis devise extension, will ensure that devise will update a flag/timestamp on the model whenever a user is set.\nWith this kind of feature you could show in your views something like **last seen 3 weeks ago** or **last seen 2 minutes ago**.\n\n[![ruby gem](https://github.com/brunoocasali/devise_last_seen/actions/workflows/gem.yml/badge.svg)](https://github.com/brunoocasali/devise_last_seen/actions/workflows/gem.yml)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/056e2b80cbcdb5d7b402/test_coverage)](https://codeclimate.com/github/brunoocasali/devise_last_seen/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/056e2b80cbcdb5d7b402/maintainability)](https://codeclimate.com/github/brunoocasali/devise_last_seen/maintainability)\n\n## Installation\n\nYou know, add this line to your application's Gemfile:\n\n```ruby\ngem 'devise_last_seen'\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\nIn your model, add `:lastseenable` module as such:\n\n```rb\n# app/models/user.rb\n\nclass User \u003c ApplicationRecord\n  devise :database_authenticable, ..., :lastseenable\nend\n```\n\nGenerate a rails migration to add the column to your devise model:\n\n```\nbundle exec rails g migration add_last_seen_to_users last_seen:datetime\n```\n\n```rb\nclass AddLastSeenToUsers \u003c ActiveRecord::Migration[6.1]\n  def change\n    add_column :users, :last_seen, :datetime\n  end\nend\n```\n\n## Configuration\n\nBesides the column requirement you don't need customizations, but if you want to...\n\n```rb\n# config/initializers/devise.rb\n\nDevise.setup do |config|\n  ...\n\n  # Interval (in seconds) to update the :last_seen_at_attribute attr\n  # config.last_seen_at_interval = 5.minutes\n\n  # Attribute who will be updated every time a user is set by the Warden's after_save callback\n  # Remember to check if this column name is present on the devise model table.\n  # config.last_seen_at_attribute = :last_seen\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. \n\nTo install this gem onto your local machine, run `bundle exec rake install`. \nTo release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/brunoocasali/devise_last_seen. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the `devise_last_seen` project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/devise_last_seen/blob/master/CODE_OF_CONDUCT.md).\n\n\n## Hall of fame!\n\nThis gem only could be done with help of other gems like:\n\n- @shenoudab [devise_traceable](https://github.com/shenoudab/devise_traceable)\n- @devise-security [devise-security](https://github.com/devise-security/devise-security)\n- @heartcombo [devise](https://github.com/heartcombo/devise)\n- @ctide [devise_lastseenable](https://github.com/ctide/devise_lastseenable)\n- @iplan [iplan-devise-lastseenable](https://github.com/iplan/iplan-devise-lastseenable)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunoocasali%2Fdevise_last_seen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunoocasali%2Fdevise_last_seen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunoocasali%2Fdevise_last_seen/lists"}