{"id":20061629,"url":"https://github.com/tylerrick/paper_trail-rails","last_synced_at":"2025-07-17T19:33:11.607Z","repository":{"id":56887402,"uuid":"188090739","full_name":"TylerRick/paper_trail-rails","owner":"TylerRick","description":"Integrate with rails console and migrations. In rails console, ask who is making change and why. Records the command.","archived":false,"fork":false,"pushed_at":"2023-06-15T17:07:53.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T14:18:29.647Z","etag":null,"topics":["papertrail","rails","ruby"],"latest_commit_sha":null,"homepage":null,"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/TylerRick.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-22T18:12:21.000Z","updated_at":"2024-12-31T13:50:05.000Z","dependencies_parsed_at":"2022-08-20T16:00:11.582Z","dependency_job_id":null,"html_url":"https://github.com/TylerRick/paper_trail-rails","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Fpaper_trail-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Fpaper_trail-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Fpaper_trail-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerRick%2Fpaper_trail-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TylerRick","download_url":"https://codeload.github.com/TylerRick/paper_trail-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252533691,"owners_count":21763640,"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":["papertrail","rails","ruby"],"created_at":"2024-11-13T13:21:00.443Z","updated_at":"2025-05-05T16:30:42.146Z","avatar_url":"https://github.com/TylerRick.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PaperTrail::Rails\n\n[![Gem Version][1]][2]\n[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://rdoc.info/github/TylerRick/paper_trail-rails/master)\n\nAn extension to [PaperTrail](https://github.com/paper-trail-gem/paper_trail)\nthat adds some useful automatic integrations with Rails:\n\n- Automatically record which migration made the change in the version record (in\n  the `command` attribute) when migrations make changes to data.\n- Automatically record `rails console` as the command in the version record (in\n  the `command` attribute).\n- Automatically record the source location that initiated the change so you can\n  figure out what caused caused the change later when inspecting a version\n  record\n- (Optional) Never forget to set the actor (whodunnit) when making changes in the `rails\n  console`. It will prompt you to choose an actor user as soon as you try to\n  make a change that would record a PaperTrail Version. (Enter `system` if you\n  don't want any particular user recorded as the actor.)\n- (Optional) Automatically ask for a reason whenever you make a change\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'paper_trail-rails'\n```\n\nAnd then execute:\n\n    $ bundle\n\nAdd and run this migration:\n```\nclass VersionsAddSourceLocationCommandReason \u003c ActiveRecord::Migration[5.2]\n  def change\n    change_table :versions do |t|\n      t.text    :source_location\n      t.text    :command\n      t.text    :reason\n    end\n    change_table :versions do |t|\n      t.index   :command\n      t.index   :reason\n    end\n  end\nend\n```\n\n## Configuration\n\nAdd to `config/initializers/paper_trail.rb` and change as needed:\n\n```ruby\nPaperTrail::Rails.configure do |config|\n  config.console.ask_for_user      = true\n  config.console.require_user      = false\n  config.console.auto_reset_user   = false\n\n  config.console.ask_for_reason    = true\n  config.console.require_reason    = false\n  config.console.auto_reset_reason = true\n\n  config.user_filter = -\u003e(users) { users.admins }\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To 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/TylerRick/paper_trail-rails.\n\n[1]: https://badge.fury.io/rb/paper_trail-rails.svg\n[2]: https://rubygems.org/gems/paper_trail-rails\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerrick%2Fpaper_trail-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylerrick%2Fpaper_trail-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylerrick%2Fpaper_trail-rails/lists"}