New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

trackstamps-reborn

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trackstamps-reborn

  • 0.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

trackstamps-reborn

Gem Version Test

Track which user created or updated record in Rails.

Inspired and part of code used from original Trackstamps gem


Quick start

$ bundler install trackstamps-reborn

Hook current_user into CurrentAttributes

class ApplicationController < ActionController::Base
  before_action :set_trackstamps_user  

  def set_trackstamps_user
    Trackstamps::Reborn::Current.user = current_user
    # or use your current attributes class with proc override in initializers
    YourCurrentAttributesClass.user = current_user
  end
end

Override implementation for current user

## filename: config/initializers/trackstamps-reborn.rb
Trackstamps::Reborn.config.get_current_user = -> { YourCurrentAttributesClass.user }
# or
Trackstamps::Reborn[:alternative].config.get_current_user = -> { YourAlternativeCurrentAttributesClass.user }

Generate migrations

rails generate trackstamps:reborn:migration table_name

Include trackstamps

class Example < ActiveRecord::Base
  include Trackstamps::Reborn
  # or
  include Trackstamps::Reborn[:whatever]
end

Multiple configuration

Multiple configuration is achieved with module builder pattern utilizing self.[] method. Upon calling

Trackstamps::Reborn[:whatever]

specific module is cached in ::Concurrent::Map instance.

Support

If you want to report a bug, or have ideas, feedback or questions about the gem, let me know via GitHub issues and I will do my best to provide a helpful answer. Happy hacking!

License

The gem is available as open source under the terms of the MIT License.

Code of conduct

Everyone interacting in this project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Contribution guide

Pull requests are welcome!

FAQs

Package last updated on 01 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc